Page 1 of 1
pass a parameter to ActionGetReportSnapshot action?
Posted: Thu Sep 06, 2012 4:53 pm
by grahampcharles
I'm trying to write a generic GetReportSnapshot action, along the lines of:
Code: Select all
public ActionResult GetReportSnapshot(string ReportPath)
{
// Create the report object and load data
StiReport report = new StiReport();
report.Load(Server.MapPath(ReportPath));
return StiMvcViewerFxHelper.GetReportSnapshotResult(report, this.Request);
But, of course, I can't compel the StiMvcViewerFx control to pass a parameter to the GetReportSnapshot action. Any ideas how I might accomplish that? I don't want to have to write a new action for every single report in my application.
Thanks for your thoughts!
g.
Re: pass a parameter to ActionGetReportSnapshot action?
Posted: Fri Sep 07, 2012 10:43 am
by Vladimir
Hello,
Unfortunately, at this moment a viewer does not transfer any parameters when request the report. To save the report ID or other params, please try to use server session or cache, also you can use the URL routes:
Thank you.
Re: pass a parameter to ActionGetReportSnapshot action?
Posted: Mon Sep 17, 2012 1:49 am
by grahampcharles
Thanks, I'll make that work! It would be great to get access to the QueryString or some ad-hoc parameters, too, but no biggie.
"Let things work they way they are designed to work..."

,
g.
Re: pass a parameter to ActionGetReportSnapshot action?
Posted: Mon Sep 17, 2012 2:12 pm
by Vladimir
Hello,
We are always glad to help you!
We are constantly improving our products and add new features.
Thank you.
Re: pass a parameter to ActionGetReportSnapshot action?
Posted: Thu Nov 01, 2012 12:16 pm
by brianj774
I am also building a generic "getReportSnapshot" action, and could use an easier way to manage 'parameters'... thanks!
Re: pass a parameter to ActionGetReportSnapshot action?
Posted: Fri Nov 02, 2012 8:20 am
by HighAley
Hello.
Do you have any problems with it?
Thank you.
Re: pass a parameter to ActionGetReportSnapshot action?
Posted: Fri Jan 18, 2013 6:39 pm
by alulko
Hi, I'm running into the same issue with the StiMvcMobileViewer (mobile) version. Trying to load the report viewer via Ajax call from a main view and pass data to it based on the user selection in the main view. Ajax calls a controller method "LoadReportView" passing user selection data and then returns the partial view which contains @Html.Stimulsoft().StiMvcMobileViewer.
Now "GetReportSnapshot" method in the controller gets called automatically but the data passed from the previous step seems to be lost.
It would be nice to be able to pass data to StiMvcMobileViewer object.
For example:
@Html.Stimulsoft().StiMvcMobileViewer(new StiMvcMobileViewerOptions{
ActionGetReportSnapshot = "GetReportSnapshot",
GetReportSnapshotData = data
})
Re: pass a parameter to ActionGetReportSnapshot action?
Posted: Mon Jan 21, 2013 12:31 pm
by HighAley
Hello.
As a way you could use a session for parameter passing.
For example, you could store data in the
LoadReportView method:
In the
GetReportSnapshot method you could read this data:
Thank you.
Re: pass a parameter to ActionGetReportSnapshot action?
Posted: Mon Jan 21, 2013 1:54 pm
by alulko
Yeah, I ended up using TempData which basically relies on session state until data is read from the dictionary.
Re: pass a parameter to ActionGetReportSnapshot action?
Posted: Tue Jan 22, 2013 11:14 am
by HighAley
Hello.
It's a good news. Let us know if you will have any additional help.
Thank you.