Hi,
I am trying to pass parameters to a report using the following code:
Dim crReport As New ReportDocument()
Dim CrystalExportOptions As New ExportOptions()
Dim CrystalDiskFileDestinationOptions As New DiskFileDestinationOptions()
Dim paramFields As New CrystalDecisions.Shared.ParameterFields()
Dim paramField As New CrystalDecisions.Shared.ParameterField()
Dim discreteVal As New CrystalDecisions.Shared.ParameterDiscreteValue()
crReport.Load(rpt_report_location)
discreteVal.Value = 22
paramField.CurrentValues.Add(discreteVal)
paramFields.Add(paramField)
***crReport.DataDefinition.ParameterFields("periodID").ApplyCurrentValues(paramFields)
When attempting to execute *** code the error occurs: "Specified cast is not valid"
The parameter in the report is a number.
Any help is much appreciated
Cheers!
I am trying to pass parameters to a report using the following code:
Dim crReport As New ReportDocument()
Dim CrystalExportOptions As New ExportOptions()
Dim CrystalDiskFileDestinationOptions As New DiskFileDestinationOptions()
Dim paramFields As New CrystalDecisions.Shared.ParameterFields()
Dim paramField As New CrystalDecisions.Shared.ParameterField()
Dim discreteVal As New CrystalDecisions.Shared.ParameterDiscreteValue()
crReport.Load(rpt_report_location)
discreteVal.Value = 22
paramField.CurrentValues.Add(discreteVal)
paramFields.Add(paramField)
***crReport.DataDefinition.ParameterFields("periodID").ApplyCurrentValues(paramFields)
When attempting to execute *** code the error occurs: "Specified cast is not valid"
The parameter in the report is a number.
Any help is much appreciated
Cheers!