Reference to report parameters

Top  Previous  Next

For referring to report parameters, use the GetParameterValue method of the Report object:

 

int myParam = (int)Report.GetParameterValue("MyParameter");

 

Parameters can be nested. In this case, indicate the name of the parent parameter and after the period, the name of the child parameter:

 

Report.GetParameterValue("ParentParameter.ChildParameter")

 

Parameters have got a definite data type. It is given in the DataType property of the parameter. You must take this into account when referring to parameters. You can see a list of parameters in the "Data" window. From it, you can drag parameters into the script, during this FastReport automatically creates a code for referring to the parameters.

 

For changing the value of the parameter, use the SetParameterValue method of the report object:

 

Report.SetParameterValue("MyParameter"10);