Using the Dashboard Theme on the Website
Our sample projects and report templates can help you learn the basics of working with our products.A dashboard carries its own colors; you can read them on the server and pass them to the layout so the surrounding web page matches the dashboard.
Read the theme colors from the dashboard page. In the
How it works. The page picks up the dashboard's own palette, so the frame around the viewer blends seamlessly with the dashboard style.
Read the theme colors from the dashboard page. In the
Index action:var report = StiReport.CreateNewDashboard();
report.Load(StiNetCoreHelper.MapPath(this, $"Dashboards/{id}.mrt"));
var dashboard = report.Pages[0] as StiDashboard;
ViewBag.DashboardBackHtmlColor = ColorTranslator.ToHtml(StiDashboardStyleHelper.GetDashboardBackColor(dashboard, true));
ViewBag.BackHtmlColor = ColorTranslator.ToHtml(StiDashboardStyleHelper.GetBackColor(dashboard));
ViewBag.ForeHtmlColor = ColorTranslator.ToHtml(StiDashboardStyleHelper.GetForeColor(dashboard));StiDashboardStyleHelper.GetDashboardBackColor/GetBackColor/GetForeColor— read the dashboard's theme colors.ColorTranslator.ToHtml— convert each to an HTML color string; pass them viaViewBagto_Layout.cshtml.
How it works. The page picks up the dashboard's own palette, so the frame around the viewer blends seamlessly with the dashboard style.