Viewer is not displayed in MVC View with custom Routes
Posted: Fri Dec 09, 2016 11:09 am
Hi,
we have migrated our ASP.NET webform app to ASP.NET MVC 4 app in a theme with bootstrap style and custom routes for the most of views.
We have been working with Stimulsoft for showing reports in old web app and we want to keep on working with Stimulsoft.
We got, f.i., a view to display a invoice.
Route URL for that view is: localhost:XXXX/invoices/id/report where id is the number id of invoice.
That Route is linked to Controller: Invoices and Action: InvoiceReport (int id)
In controller i have added Actions GetReportSnapshot and ViewerEvent
In View InvoiceReport i have added following script:
But it never shows any report. In Debug Mode it never goes to Action GetReportSnapshot.
And in HTML code resultant i see this:
If i go to js file referenced i get HTML for same view.
But when i execute f.i. Samples-ASP.NET-MVC-CSharp/Change the Viewer Theme/ in html code i get this code:
and if i go to this js file i get js code for settings option for report.
In my view reference to js view doesnt contains the Action name for ViewerEvent.
So i think problem could be something about routing.
Any idea to fix it.?
thanks in advance.
we have migrated our ASP.NET webform app to ASP.NET MVC 4 app in a theme with bootstrap style and custom routes for the most of views.
We have been working with Stimulsoft for showing reports in old web app and we want to keep on working with Stimulsoft.
We got, f.i., a view to display a invoice.
Route URL for that view is: localhost:XXXX/invoices/id/report where id is the number id of invoice.
That Route is linked to Controller: Invoices and Action: InvoiceReport (int id)
In controller i have added Actions GetReportSnapshot and ViewerEvent
In View InvoiceReport i have added following script:
Code: Select all
@Html.Stimulsoft().StiMvcViewer(new StiMvcViewerOptions()
{
Actions =
{
GetReportSnapshot = "GetReportSnapshot",
ViewerEvent = "ViewerEvent",
}
})
And in HTML code resultant i see this:
Code: Select all
<div id="MvcViewer" style="background-color:White;height:100%;width:100%;"><script type="text/javascript" src="http://localhost:13530/invoices/14/report?mvcviewer_resource=scripts&mvcviewer_id=MvcViewer&mvcviewer_theme=Office2013&mvcviewer_version=2016.2"></script>
But when i execute f.i. Samples-ASP.NET-MVC-CSharp/Change the Viewer Theme/ in html code i get this code:
Code: Select all
<div id="MvcViewer" style="background-color:White;height:100%;width:100%;"><script type="text/javascript" src="http://localhost:53101/Viewer/ViewerEvent?mvcviewer_resource=scripts&mvcviewer_id=MvcViewer&mvcviewer_theme=Office2013&mvcviewer_version=2016.3"></script>
In my view reference to js view doesnt contains the Action name for ViewerEvent.
So i think problem could be something about routing.
Any idea to fix it.?
thanks in advance.