Skip to main content
Version: 4.2.1

Dashboard Component

The dReveal dashboard is a component compatible with ASP.Net MVC using .Net Framework 4.8.1. The dReveal dashboard component requires a controller and a view, to follow ASP.Net MVC architecture, in order to visualize it seamlessly in a hosting application with the framework requirements mentioned previously.

Controller

In the controller is required to create an action method to instance a DashboardViewModel class in it. See the following sample code:

public ActionResult SimpleDashboard()
{
DashboardViewModel viewModel = new DashboardViewModel(
memoryStream: fileStream,
connectionString: "Data Source=MyServer; Initial Catalog=myDatabase; User ID=myUser; Password=myPassword",
dashboardId: "dashboard_id",
htmlFormId: "main_form",
fullGridControllerActionPath: HttpContext.Request.Url.AbsolutePath,
useNewExportToImagePro: true,
filterComponentParentId: string.Empty,
drillThroughControllerAction: string.Empty,
saveDashboardControllerAction: string.Empty,
excelXlsxExportControllerAction: string.Empty
);
viewModel.LoadInitialConfiguration();

return View("ShowDashboard", viewModel);
}
note

The memoryStream parameter receives in-memory data represented by a .dDashX file. For further information refer to the DashboardViewModel documentation.

View

The dReveal dashboard component provides a method to be able of visualizing it throughout a razor page. It is possible to invoke this method following manner:

    @Html.InfoArch().Dashboard(@Model.DashboardSettings).GetHtml()

The DashboardSettings is the parameter required by the method mentioned above and prepared in the controller to load it in the view. See the previous topic for further information about the load process. The following code shows how to use the method in a view:

@using InfoArch.Web.Mvc.Dashboard

@model DashboardViewModel

<div id="reporting-dashboard">
<div id="dashboard-container">
@Html.InfoArch().Dashboard(@Model.DashboardSettings).GetHtml()
</div>
</div>
note

The sample code is assuming that the required static resources (Stylesheets and Scripts files) were incorporated. For further information see the Static Resources documentation.