I need to pass parameters from VB 6.0 to Crystal 8.5.
Then, export the report as a pdf
If I do not assign values to the parameter this works and exports (to pdf) the previously saved values.
If I just pass the parameters and view the report it works.
BUT when I do both I get a 'Server has not yet been opened' message
I have tried switching CRAXDDRT to CRAXDRT for each declaration.
Also, the SetLogOnInfo is correct and is the same (info) as the report
Dim crxExportOptions As CRAXDDRT.ExportOptions
Dim crxApplication As New CRAXDDRT.Application
Dim crxReport As CRAXDDRT.Report
Set crxReport = crxApplication.OpenReport(App.Path & "\" & "TEST.rpt"
'crxReport.DiscardSavedData
crxReport.Database.Tables(1).SetLogOnInfo "SQL01", "dbname", "dev1", "dev1"
'Set the parameters
crxReport.ParameterFields(1).AddCurrentValue strBegin
crxReport.ParameterFields(2).AddCurrentValue strEnd
Set crxExportOptions = crxReport.ExportOptions
crxReport.ExportOptions.DestinationType = crEDTDiskFile
crxExportOptions.DiskFileName = "c:\" & strRepName & ".pdf"
crxReport.ExportOptions.FormatType = crEFTPortableDocFormat
crxReport.Export False
Thank You
Then, export the report as a pdf
If I do not assign values to the parameter this works and exports (to pdf) the previously saved values.
If I just pass the parameters and view the report it works.
BUT when I do both I get a 'Server has not yet been opened' message
I have tried switching CRAXDDRT to CRAXDRT for each declaration.
Also, the SetLogOnInfo is correct and is the same (info) as the report
Dim crxExportOptions As CRAXDDRT.ExportOptions
Dim crxApplication As New CRAXDDRT.Application
Dim crxReport As CRAXDDRT.Report
Set crxReport = crxApplication.OpenReport(App.Path & "\" & "TEST.rpt"
'crxReport.DiscardSavedData
crxReport.Database.Tables(1).SetLogOnInfo "SQL01", "dbname", "dev1", "dev1"
'Set the parameters
crxReport.ParameterFields(1).AddCurrentValue strBegin
crxReport.ParameterFields(2).AddCurrentValue strEnd
Set crxExportOptions = crxReport.ExportOptions
crxReport.ExportOptions.DestinationType = crEDTDiskFile
crxExportOptions.DiskFileName = "c:\" & strRepName & ".pdf"
crxReport.ExportOptions.FormatType = crEFTPortableDocFormat
crxReport.Export False
Thank You