I have a VB6 program using an Access97 database through ADO and DAO.
I added CR9 RDC to view/print several predesigned .RPTs.
My problem is I want to feed the .RPTs different table names than the ones that they were originally created to use.
The different tables are all identical formats.
I cannot find a way to pass the .RPTs a different table name to run from even though the fields are all the same.
There must be a way to tell the CR application report object to use a different table on the fly when everything else is the same.
Example:
Proof.rpt created using table name 'TimesheetsKraft'.
I want to run the following basic code for tables:
'TimesheetsIBM', 'TimesheetsWendys' and
'TimesheetsGoogle' as well.
Global crxApplication As CRAXDRT.Application
Global crxReport As CRAXDRT.Report
Set crxApplication =
CreateObject "CrystalRuntime.Application")
Set crxReport = crxApplication.OpenReport
(conReportPath & "\Proof.rpt")
With crxReport
For xx = 1 To .Database.Tables.Count
.Database.Tables(xx).SetSessionInfo "", Chr(10)
& GetPassword
Next xx
.ReplacementTableName(1) 'TimesheetsWendys'
.ParameterFields(1).AddCurrentValue dtmStartDate
.ParameterFields(2).AddCurrentValue dtmEndDate
End With
Load frmCRViewer
Note the new property called .ReplacementTableName.
Does this simple and straight forward ability exist?
I hope I have been able to explain my situation well enough.
Thanks in advance for your time.
Oh, I have searched Tek-Tips and Business Objects but never found a clear answer. Most concerned changing the path of a database and lots involved changing the Location/Alias of a .RPT internally.
Thanks.
I added CR9 RDC to view/print several predesigned .RPTs.
My problem is I want to feed the .RPTs different table names than the ones that they were originally created to use.
The different tables are all identical formats.
I cannot find a way to pass the .RPTs a different table name to run from even though the fields are all the same.
There must be a way to tell the CR application report object to use a different table on the fly when everything else is the same.
Example:
Proof.rpt created using table name 'TimesheetsKraft'.
I want to run the following basic code for tables:
'TimesheetsIBM', 'TimesheetsWendys' and
'TimesheetsGoogle' as well.
Global crxApplication As CRAXDRT.Application
Global crxReport As CRAXDRT.Report
Set crxApplication =
CreateObject "CrystalRuntime.Application")
Set crxReport = crxApplication.OpenReport
(conReportPath & "\Proof.rpt")
With crxReport
For xx = 1 To .Database.Tables.Count
.Database.Tables(xx).SetSessionInfo "", Chr(10)
& GetPassword
Next xx
.ReplacementTableName(1) 'TimesheetsWendys'
.ParameterFields(1).AddCurrentValue dtmStartDate
.ParameterFields(2).AddCurrentValue dtmEndDate
End With
Load frmCRViewer
Note the new property called .ReplacementTableName.
Does this simple and straight forward ability exist?
I hope I have been able to explain my situation well enough.
Thanks in advance for your time.
Oh, I have searched Tek-Tips and Business Objects but never found a clear answer. Most concerned changing the path of a database and lots involved changing the Location/Alias of a .RPT internally.
Thanks.