Hi...
I am using reports made in CR 8, and I am developing a web app in ASP.net using VB.net that looks at all reports in a specific directory and when you click on the report it checks for parameters and then displays the report with the CrystalReportViewer.
The problem is this:
One of the reports has 2 subreports. I need to know how to handle the parameters that are in those subreports. If I leave them out (not populate them) I get a "parameter missing" error. If I populate the 2 fields (one for each subreport) I get a "Operation illegal on linked parameter".
Please help, my code is posted below... any suggestions are helpfull
If crReportDocument.DataDefinition.ParameterFields.Count > 0 Then '======if report has Parameter Fields
For Each Param In crReportDocument.DataDefinition.ParameterFields
Select Case Param.ParameterValueKind
Case ParameterValueKind.BooleanParameter
Case ParameterValueKind.CurrencyParameter
Case ParameterValueKind.DateParameter
Case ParameterValueKind.DateTimeParameter
Case ParameterValueKind.NumberParameter
Case ParameterValueKind.StringParameter
Dim discvalue As New ParameterDiscreteValue
Dim currentValues As ParameterValues
Dim discreteParam As ParameterDiscreteValue
For Each discvalue In Param.CurrentValues
currentValues = Param.CurrentValues
discreteParam = New ParameterDiscreteValue
discreteParam.Value = "HDUS00000291600"
currentValues.Add(discreteParam)
Param.ApplyCurrentValues(currentValues)
Next
Case ParameterValueKind.TimeParameter
End Select
End If
Next
End If
I am using reports made in CR 8, and I am developing a web app in ASP.net using VB.net that looks at all reports in a specific directory and when you click on the report it checks for parameters and then displays the report with the CrystalReportViewer.
The problem is this:
One of the reports has 2 subreports. I need to know how to handle the parameters that are in those subreports. If I leave them out (not populate them) I get a "parameter missing" error. If I populate the 2 fields (one for each subreport) I get a "Operation illegal on linked parameter".
Please help, my code is posted below... any suggestions are helpfull
If crReportDocument.DataDefinition.ParameterFields.Count > 0 Then '======if report has Parameter Fields
For Each Param In crReportDocument.DataDefinition.ParameterFields
Select Case Param.ParameterValueKind
Case ParameterValueKind.BooleanParameter
Case ParameterValueKind.CurrencyParameter
Case ParameterValueKind.DateParameter
Case ParameterValueKind.DateTimeParameter
Case ParameterValueKind.NumberParameter
Case ParameterValueKind.StringParameter
Dim discvalue As New ParameterDiscreteValue
Dim currentValues As ParameterValues
Dim discreteParam As ParameterDiscreteValue
For Each discvalue In Param.CurrentValues
currentValues = Param.CurrentValues
discreteParam = New ParameterDiscreteValue
discreteParam.Value = "HDUS00000291600"
currentValues.Add(discreteParam)
Param.ApplyCurrentValues(currentValues)
Next
Case ParameterValueKind.TimeParameter
End Select
End If
Next
End If