Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CR: Specified cast is not valid

Status
Not open for further replies.

dingo1495

Programmer
Feb 7, 2006
3
AU
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!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top