Dynamic Name Report
Dynamic Name Report
Hi,
Use Asp.NET MVC, and I need to create dynamic reports names, therefore, to call my view the report while the name of this parameter, but just do load the report on the event passed to the "ActionGetReportSnapshot" and it does not have as pass parameters because it is triggered internally, you have a suggestion for me to solve this problem? Something provided by Stimulsoft?
Thanks in advance,
Tânia
Use Asp.NET MVC, and I need to create dynamic reports names, therefore, to call my view the report while the name of this parameter, but just do load the report on the event passed to the "ActionGetReportSnapshot" and it does not have as pass parameters because it is triggered internally, you have a suggestion for me to solve this problem? Something provided by Stimulsoft?
Thanks in advance,
Tânia
Re: Dynamic Name Report
Hello, Tânia.
You could set report name with next code:
Thank you.
You could set report name with next code:
Code: Select all
report.ReportName = "MyDynamicReportName";
Re: Dynamic Name Report
Sorry, but I could not expose my need.
I have my controller, which possess the Actions that need as Index, GetReportSnapshot, ViewerEvent. In Action GetReportSnapshot, I Load the report, but the report name is dynamic, this name is passed to another view, when calling my Action report, this time I have the name of the report, but I can not pass this name to the Action GetReportSnapshot because Stimulsoft that triggers this action. Basically, I need to do the same thing you do here ... http://mobile.stimulsoft.com/
You have the same data, same action, same view, only report calls differently.
I thought of a way to do it, but it would be a 'jerry-rig', I wonder if you have an example of how I could do what I need.
I'm currently testing the Mobile MVC, if you possess such...
Thank you.
I have my controller, which possess the Actions that need as Index, GetReportSnapshot, ViewerEvent. In Action GetReportSnapshot, I Load the report, but the report name is dynamic, this name is passed to another view, when calling my Action report, this time I have the name of the report, but I can not pass this name to the Action GetReportSnapshot because Stimulsoft that triggers this action. Basically, I need to do the same thing you do here ... http://mobile.stimulsoft.com/
You have the same data, same action, same view, only report calls differently.
I thought of a way to do it, but it would be a 'jerry-rig', I wonder if you have an example of how I could do what I need.
I'm currently testing the Mobile MVC, if you possess such...
Thank you.
Re: Dynamic Name Report
Hello.
You could find sample project in the installation folder.
Thank you.
You could find sample project in the installation folder.
Thank you.
Re: Dynamic Name Report
Sorry, not found in the Samples folder a project that exemplifies what I need. But I could do what I needed.
Thank you.
Thank you.
Re: Dynamic Name Report
Hello.
Here is code from our sample project "MvcMobileViewer (Razor)":
Thank you.
Here is code from our sample project "MvcMobileViewer (Razor)":
Code: Select all
public ActionResult GetReportSnapshot()
{
// Create the report object and load data from xml file
StiReport report = new StiReport();
DataSet data = new DataSet("Demo");
data.ReadXml(Server.MapPath("~/Content/Data/Demo.xml"));
// Restore the route values collection and get the id value
RouteValueDictionary routeValues = StiMvcMobileViewer.GetRouteValues(this.HttpContext);
int id = 1;
if (routeValues["id"] != null) id = Convert.ToInt32(routeValues["id"]);
// Load report
switch (id)
{
// Load report snapshot
case 1:
report.LoadDocument(Server.MapPath("~/Content/Reports/SimpleList.mdc"));
break;
// Load report template
case 2:
report.Load(Server.MapPath("~/Content/Reports/TwoSimpleLists.mrt"));
report.RegData(data);
break;
// Load compiled report class
case 3:
report = new StiMasterDetail();
report.RegData(data);
break;
}
return StiMvcMobileViewer.GetReportSnapshotResult(HttpContext, report);
}