Value of Parameters in PageHeader

Stimulsoft Reports.NET discussion
Post Reply
iomega55
Posts: 29
Joined: Sat Sep 23, 2006 1:37 am

Value of Parameters in PageHeader

Post by iomega55 »

Hi:

I need to print the parameters I sent to my report from my webapp in the PageHeader.

I sent the parameters in this way:
report.CompiledReport.DataSources["ds1"].Parameters["@param1"].ParameterValue = 123;
report.CompiledReport.DataSources["ds1"].Parameters["@param2"].ParameterValue = "20061001;

In the report designer how can I get the values for @param1 and @param2 for print in the page header.

Thanks.
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Value of Parameters in PageHeader

Post by Edward »

Please use the following format of expression:
{ds1.Parameters["@param1"].ParameterValue}

You also may to drag to the report page any field or parameter from the reports dictionary. StiText component with a required expression will be created automatically in it.

Thank you.
iomega55
Posts: 29
Joined: Sat Sep 23, 2006 1:37 am

Value of Parameters in PageHeader

Post by iomega55 »

Thanks it works.

Just one dude, How can I send a parameter from my webapp to the report when this parameter isnot assigned or created inside a datasource. Is it possible?

Thanks
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Value of Parameters in PageHeader

Post by Edward »

You can use variables in your report. You should to declare a variable in your report template (with unchecked read only parameter) and then you may to assign
value to this variable from the code of your Application.

Code: Select all

report.Compile();
report["VariableName"] = "Value";
Thank you.
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Value of Parameters in PageHeader

Post by Edward »

You can use variables in your report. You should to declare a variable in your report template (with unchecked read only parameter) and then you may to assign
value to this variable from the code of your Application.

Code: Select all

report.Compile();
report["VariableName"] = "Value";
Thank you.
iomega55
Posts: 29
Joined: Sat Sep 23, 2006 1:37 am

Value of Parameters in PageHeader

Post by iomega55 »

Ed, thanks again.

Just one comment for the community. I named my vars starting with an @ :(, so it generates an error 'Field xxx not found'. Finally I remove @ and all works like a charm.
Post Reply