I have an app that opens a crystal report, sets the login info, passes the parameter, then exports the report. Below is part of the code I am using. I need to run this report multiple times with new parameter values. How can this be accomplished without doing OpenReport everytime?
Dim Report As New CRAXDRT.Report
Dim crxApp As New CRAXDRT.Application
Sub RunReport()
Set Report = crxApp.OpenReport("test.rpt",1)
'''Here I set the login
Report.ParameterFields(1).AddCurrentValue (ldr_id)
With Report.ExportOptions
.DiskFileName = slocation
.FormatType = crEFTPortableDocFormat
.PDFExportAllPages = True
.DestinationType = crEDTDiskFile
End With
Report.Export (False)
Set Report = Nothing
Set crxApplication = Nothing
End sub
Dim Report As New CRAXDRT.Report
Dim crxApp As New CRAXDRT.Application
Sub RunReport()
Set Report = crxApp.OpenReport("test.rpt",1)
'''Here I set the login
Report.ParameterFields(1).AddCurrentValue (ldr_id)
With Report.ExportOptions
.DiskFileName = slocation
.FormatType = crEFTPortableDocFormat
.PDFExportAllPages = True
.DestinationType = crEDTDiskFile
End With
Report.Export (False)
Set Report = Nothing
Set crxApplication = Nothing
End sub