I'm using the RDC in VB6 to export a CR8.5 report to .PDF format. The report is based on a SQL Server stored proc that expects 5 parameters. I've tried using the parameterfields method to add the parameters, but I get a subscript out of range error.
Can anyone help me get the parameters thru to the report?
Code is as follows:
With rdcReport
For n = 1 To .Database.Tables.Count
.Database.Tables.SetLogOnInfo "Europe"
Next n
.ExportOptions.FormatType = crEFTPortableDocFormat
.ExportOptions.DestinationType = crEDTDiskFile
.ExportOptions.DiskFileName = sPath & "\" & sReportName & ".pdf"
.ExportOptions.PDFExportAllPages = True
.ParameterFields(0) = "@dtToday;'" & sParameter(0) & "'; True"
.ParameterFields(1) = "@dtYesterday;'" & sParameter(1) & "'; True"
.ParameterFields(2) = "@dtPrMth;'" & sParameter(2) & "'; True"
.ParameterFields(3) = "@vType;'" & sParameter(3) & "'; True"
.ParameterFields(4) = "@vRerun;'" & sParameter(4) & "'; True"
.DiscardSavedData
.Export False
End With
Thx,
jacqui
Can anyone help me get the parameters thru to the report?
Code is as follows:
With rdcReport
For n = 1 To .Database.Tables.Count
.Database.Tables.SetLogOnInfo "Europe"
Next n
.ExportOptions.FormatType = crEFTPortableDocFormat
.ExportOptions.DestinationType = crEDTDiskFile
.ExportOptions.DiskFileName = sPath & "\" & sReportName & ".pdf"
.ExportOptions.PDFExportAllPages = True
.ParameterFields(0) = "@dtToday;'" & sParameter(0) & "'; True"
.ParameterFields(1) = "@dtYesterday;'" & sParameter(1) & "'; True"
.ParameterFields(2) = "@dtPrMth;'" & sParameter(2) & "'; True"
.ParameterFields(3) = "@vType;'" & sParameter(3) & "'; True"
.ParameterFields(4) = "@vRerun;'" & sParameter(4) & "'; True"
.DiscardSavedData
.Export False
End With
Thx,
jacqui