ParameterValue problems

Stimulsoft Reports.NET discussion
Post Reply
fuhrj
Posts: 120
Joined: Wed Jun 11, 2008 12:51 pm
Location: Lancaster, Ohio

ParameterValue problems

Post by fuhrj »

I have written a process in C# to automatically run a report. The report contains a SQl parameter, which I tried setting like this:

Code: Select all

report.Dictionary.DataSources[0].Parameters["@locationID"].ParameterValue = "1";
report.Render(false);
However, I get an error saying that @locationID was not set.

The report will run if I set it like this:

Code: Select all

report["@locationID"] = "1"
Why does it not work when explicitly setting the parameter value as in the first example?
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: ParameterValue problems

Post by HighAley »

Hello.

Please, try to use next code:

Code: Select all

report.Dictionary.DataSources[0].Parameters["@locationID"].Value = "1";
report.Render(false);
Thank you.
fuhrj
Posts: 120
Joined: Wed Jun 11, 2008 12:51 pm
Location: Lancaster, Ohio

Re: ParameterValue problems

Post by fuhrj »

Hi, I tried using Value in place of ParameterValue and got the same result.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: ParameterValue problems

Post by Alex K. »

Hello,

Can you please send us your report with test data for analysis.

Thank you.
fuhrj
Posts: 120
Joined: Wed Jun 11, 2008 12:51 pm
Location: Lancaster, Ohio

Re: ParameterValue problems

Post by fuhrj »

Report attached. You can probably just use any database because it doesn't get past the point of actually pulling any data.
Attachments
serviceRequestActivity.mrt
(69.73 KiB) Downloaded 258 times
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: ParameterValue problems

Post by Alex K. »

Hello,

We couldn't reproduce this bug on our data.
Can you please check the last prerelease build and let us know about the result.

Thank you.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: ParameterValue problems

Post by Alex K. »

Hello.

Please, try to use next code:

Code: Select all

report.Dictionary.DataSources["DataSourceName"].Parameters["ParameterName"].Value = yourvalue;
Post Reply