Showing a Dashboard in the Viewer
Our sample projects and report templates can help you learn the basics of working with our products.The Stimulsoft web viewer displays interactive dashboards in ASP.NET Core MVC just as it displays reports.
Adding the viewer to a view. Use the
Serving the dashboard from the controller. Create a dashboard with
How it works. A dashboard is a
Adding the viewer to a view. Use the
@Html.StiNetCoreViewer helper with the actions the viewer should call:@using Stimulsoft.Report.Mvc;
@Html.StiNetCoreViewer(new StiNetCoreViewerOptions()
{
Actions =
{
GetReport = "GetReport",
ViewerEvent = "ViewerEvent"
}
})Serving the dashboard from the controller. Create a dashboard with
CreateNewDashboard(), load an .mrt, and return it:public IActionResult GetReport()
{
var report = StiReport.CreateNewDashboard();
report.Load(StiNetCoreHelper.MapPath(this, "Dashboards/DashboardChristmas.mrt"));
return StiNetCoreViewer.GetReportResult(this, report);
}
public IActionResult ViewerEvent()
{
return StiNetCoreViewer.ViewerEventResult(this);
}How it works. A dashboard is a
StiReport created with CreateNewDashboard(). The viewer requests it through GetReport, and the interactive dashboard — charts, tables, gauges and filters — is rendered in the browser, with every interaction routed back to the controller.