How can I pass parameters into a report from JavaScript?
We have a custom reporting system and parameters are extracted from the report and placed in a grid. Eventually the parameters will be hidden (RequestFromUser = false) from the actual report viewer control.
What I want to do is basically control the report much the same way as the existing controls do.
Report parameters
Report parameters
- Attachments
-
- snip.PNG (147.95 KiB) Viewed 1491 times
Re: Report parameters
Hello,
Passing parameters to a report using Javascript is not provided. You can set the report parameters on the server side, passing them using the GET or POST requests.
Thank you.
Passing parameters to a report using Javascript is not provided. You can set the report parameters on the server side, passing them using the GET or POST requests.
Thank you.
Re: Report parameters
How do your controls do it then? It's doesn't seem to cause a postback, or does it?
If I did pass in the variables say as parameters to the page, how do I set them against the report and then run the report? Do I just do stim_report[var] = ...?
Currently I do something like this:
If I did pass in the variables say as parameters to the page, how do I set them against the report and then run the report? Do I just do stim_report[var] = ...?
Currently I do something like this:
Code: Select all
// Work out reports filename
string filename = Path.Combine(path,report.Path);
// Set up report viewer
StiReport stim_report = new StiReport();
stim_report.Load(filename);
stim_report.Compile();
#if !DEBUG
foreach(StiVariable v in stim_report.Dictionary.Variables.Items) v.RequestFromUser = false;
#endif
webViewer.Report = stim_report;
Re: Report parameters
Hello,
You can set the parameters for the report as follows:
or:
Thank you.
You can set the parameters for the report as follows:
Code: Select all
StiReport stim_report = new StiReport();
stim_report.Load(filename);
stim_report.Compile();
stim_report["VarName1"] = value1;
stim_report["VarName2"] = value2;
stim_report.Render(false);
Code: Select all
StiReport stim_report = new StiReport();
stim_report.Load(filename);
foreach(StiVariable v in stim_report.Dictionary.Variables)
{
v.RequestFromUser = false;
v.Value = somevalue;
}
stim_report.Compile();
stim_report.Render(false);