Hello Alesey,
thank you for your answer, please let me restate my question.
It's somehow (very?) adavanced.
1) My Controller of the page and the controller of the Report handling are
totally separated. The even reside in differend ASP.Net MVC Areas.
2) I use AJAX + Partial layouts to load the partial views from the
reporter controller on demand.
3) I'd like to have a way to paramterize the toplevel function.
For my question I am refering to this file:
MvcMobileViewer (Razor)\MvcMobileViewer (Razor)\Controllers\.HomeController.cs
Code: Select all
public ActionResult Index()
{
ViewBag.Message = "Welcome to ASP.NET MVC Stimulsoft Demo";
return View();
}
In my case the Index method is parameterized with some userdata string:
ReportController.cs:
Code: Select all
public ActionResult Index(string UserData)
{
ViewBag.UserData = UserData; // neet to happen: persist this value as Index is the starting call
return PartialView("_Viewer.cshtml", UserData);
}
What i want to have a way to have the userdata in all internal Stimulsoft Actions.
That means it have to loop from the Controler (via Model/Viewbag) to the Flash
and on ActionCalls from flash back to the controller:
The View:
Code: Select all
@Html.Stimulsoft().StiMvcViewerFx(new StiMvcViewerFxOptions() {
ActionGetReportSnapshot = "GetReportSnapshot",
ActionGetLocalization = "GetLocalization",
ActionExportReport = "ExportReport",
UserData = ViewBag.UserData /* doesn't exist, yet! */
})
Code: Select all
public ActionResult GetReportSnapshot(string UserData)
{
StiReport report = StiMvcDesigner.GetReportObject(this.Request);
byte[] data = DecideWhatDataToLoad(UserData);
report.Load(data);
// ...
return StiMvcViewerFx.GetReportSnapshotResult(this.Request, report);
}
Is there a way to get this to work?
I am currently using a session object. However this is bad, because if
a user opens a 2nd Browser Tab the Session Data will be overwritten.
Btw. we need this vor the Viewer and for the Designer.