Hi,
I am using a webform with one text box to pass a string parameter to a CR. The code is below.
When the page loads it asks..
The report you requested requires further information.
--------------------------
----------
----------
----------
----------
----------
----
and has a textbox for the param. If I ignore this and enter my param the CR opens and displays correctly. I thought setting
CrystalReportViewer1.Enabl
eParameter
Prompt = False in the page load would stop this, but I get an error
Missing parameter values.
Anyone have any suggestions?
Private Sub GenerateRPT(ByVal ProductID As String)
' Declare variables needed to pass the parameters
' to the viewer control.
Dim paramFields As New ParameterFields()
Dim paramField As New ParameterField()
Dim discreteVal As New ParameterDiscreteValue()
'Dim rangeVal As New ParameterRangeValue()
' The first parameter is a discrete parameter with multiple values.
' Set the name of the parameter field, this must match a
' parameter in the report.
paramField.ParameterFieldN
ame = "ProductID"
' Set the first discrete value and pass it to the parameter
discreteVal.Value = ProductID
paramField.CurrentValues.A
dd(discret
eVal)
paramFields.Add(paramField
)
' Set the parameter fields collection into the viewer control.
CrystalReportViewer1.Param
eterFieldI
nfo = paramFields
CrystalReportViewer1.Repor
tSource = New Report1()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim ProdId As String
ProdId = txtProductID.Text
GenerateRPT(ProdId)
End Sub
Start Free Trial