i have a crystal report that is running off a SQL Server stored procedure. The stored procedure takes 3 parameters. when i add the stored procedure in the crystal report - the parameters automatically appear in the report (under Parameter fields) .... as
@database
@fromdate
@todate
now when i try to set the parameters in vb .net using this code:
Dim paramFields As ParameterFields
paramFields = crReportViewer.ParameterFieldInfo
Dim paramField As New ParameterField
Dim curValues As ParameterValues = paramField.CurrentValues
Try
paramField = paramFields("@database")
Catch ex As Exception
MsgBox(ex.ToString)
End Try
Dim discreteValue As ParameterDiscreteValue = New ParameterDiscreteValue
discreteValue.Value = ReportCriteria
I get an error:
"Object Reference Not Set to An Instance of an object" at the line:
paramField = paramFields("@database")