G
Guest
I'm successfully passing a SQL Input Parameter when calling a Crystal Report,
so that the user doesn't get prompted. But I can't seem to find a way to pass
it the subreport.
Code for main report:
Dim ParameterFields As New ParameterFields
Dim ParameterField As New ParameterField
Dim spValue As New ParameterDiscreteValue
ParameterField.ParameterFieldName = "@ReportGUIDString"
spValue.Value = mSearchID
ParameterField.CurrentValues.Add(spValue)
ParameterFields.Add(ParameterField)
'Pass Input Param
Me.CrystalReportViewer1.ParameterFieldInfo = ParameterFields
'Link Report Instance with Viewer
Me.CrystalReportViewer1.ReportSource = ClientReportV1
The problem appears that you link the Parameter to the Viewer, opposed to
the report. How do I pass the parameter to the subreport?
I tried the following code but it didn't work:
Dim SummarySubReport As New ReportDocument
SummarySubReport = ClientReportV1.OpenSubreport("Summary Totals")
SummarySubReport.SetParameterValue("@ReportGUIDString", mSearchID)
Thanks.
so that the user doesn't get prompted. But I can't seem to find a way to pass
it the subreport.
Code for main report:
Dim ParameterFields As New ParameterFields
Dim ParameterField As New ParameterField
Dim spValue As New ParameterDiscreteValue
ParameterField.ParameterFieldName = "@ReportGUIDString"
spValue.Value = mSearchID
ParameterField.CurrentValues.Add(spValue)
ParameterFields.Add(ParameterField)
'Pass Input Param
Me.CrystalReportViewer1.ParameterFieldInfo = ParameterFields
'Link Report Instance with Viewer
Me.CrystalReportViewer1.ReportSource = ClientReportV1
The problem appears that you link the Parameter to the Viewer, opposed to
the report. How do I pass the parameter to the subreport?
I tried the following code but it didn't work:
Dim SummarySubReport As New ReportDocument
SummarySubReport = ClientReportV1.OpenSubreport("Summary Totals")
SummarySubReport.SetParameterValue("@ReportGUIDString", mSearchID)
Thanks.