Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Easiest way to pass parameters to ActiveReports report from .NET code

How does one pass parameters needed by my SQL query in an ActiveReports report? I know about the code that goes into the ReportStart event, but how does one pass the values of the parameters to the report?

like image 680
LordHits Avatar asked Dec 04 '25 14:12

LordHits


1 Answers

Figured it out. From your class running the report:

var report = new MyReport();
report.Parameters["Parm1"].PromptUser = false;
report.Parameters["Parm1"].Value = someVariable;
report.Parameters["Parm2"].PromptUser = false;
report.Parameters["Parm2"].Value = someVariable2.ToString("M-d-yyyy");
report.Run();

Apparently, when one new ups the report, it is parsed for parameters and they are added to the Parameters collection. So you would just need to set the properties as one wishes.

like image 62
LordHits Avatar answered Dec 08 '25 06:12

LordHits



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!