Hi,
I have a report, that contains a subreport, like invoice/invoiceDetail.
Depending on a paramValue, I want to suppress some fields on subreport.
I created a paramField string type via designer on a subreport.
I set the supress checkbox on the formula editor, and wrote the formula below:
{?IsShowValue}="yes"
Then with the code tried to set value to the parameter:
I created a sub, that get the subreport, paramname, and paramvalue as parameter, and set the paramvalue.
Private Shared Sub SetBooleanParamValue(ByVal rpt As ReportDocument, ByVal paramName As String, ByVal param As String)
Dim parameterFieldDefinition As ParameterFieldDefinition
parameterFieldDefinition = rpt.DataDefinition.ParameterFields.Item(paramName)
Dim ParamValues = New ParameterValues
Dim ParamValue = New ParameterDiscreteValue
ParamValue.value = param
ParamValues.add(ParamValue)
parameterFieldDefinition.ApplyCurrentValues(ParamValues)
parameterFieldDefinition.CurrentValues.Add(ParamValue)
End Sub
My problem; despite I set the CurrentValues, when I open the report, the parameter settings form appear, as if I haden't set the parameter via code before.
What have I missed?
Thanks
Gabor