Hi all,
I have created a basic application that takes two dates and then runs a CR report.
I'm using the code below to pass the parameter from VB to my Crystal Report.
The Crystal Report is sound. I have the parameter entered, and when running a test from CR using some date parameter it pulls just fine.
WHen I try to run it through VB I get these errors:
The report will flash up, and then go to a Big red X.
"Crystal Report Window Form Viewer: The Report Application Server Failed."
"Object reference not set to an instance of an object"
I can run other Crystal reports fine, and i've used this code before. Where do I begin to find out what's wrong??
I have created a basic application that takes two dates and then runs a CR report.
I'm using the code below to pass the parameter from VB to my Crystal Report.
Code:
cr = New CrystalDecisions.CrystalReports.Engine.ReportDocument
cr.Load(string to report)
Dim param1Fields As New CrystalDecisions.Shared.ParameterFields
Dim param1Field As New CrystalDecisions.Shared.ParameterField
Dim param1Range As New CrystalDecisions.Shared.ParameterDiscreteValue
Dim param2Field As New CrystalDecisions.Shared.ParameterField
Dim param2Range As New CrystalDecisions.Shared.ParameterDiscreteValue
param1Field.ParameterFieldName = "@rstartdate"
param2Field.ParameterFieldName = "@renddate"
param1Range.Value = F1.rstartdate.Text
param2Range.Value = F1.renddate.Text
param1Field.CurrentValues.Add(param1Range)
param2Field.CurrentValues.Add(param1Range)
param1Fields.Add(param1Field)
param1Fields.Add(param2Field)
CrystalReportViewer1.ParameterFieldInfo = param1Fields 'to pass parameter inf.to CRV
CrystalReportViewer1.ReportSource = cr ' Assign Report Source to CRV
CrystalReportViewer1.Refresh()
The Crystal Report is sound. I have the parameter entered, and when running a test from CR using some date parameter it pulls just fine.
WHen I try to run it through VB I get these errors:
The report will flash up, and then go to a Big red X.
"Crystal Report Window Form Viewer: The Report Application Server Failed."
"Object reference not set to an instance of an object"
I can run other Crystal reports fine, and i've used this code before. Where do I begin to find out what's wrong??