This example shows how to show a dashboard in the viewer. First, you need to load dashboard template:
...
private StiReport GetTemplate()
{
var report = StiReport.CreateNewDashboard();
report.Load("Dashboards\\DashboardChristmas.mrt");
return report;
}
...
Next, use
Show()
method to show the dashboard:
...
private void buttonDialog_Click(object sender, EventArgs e)
{
var report = GetTemplate();
report.Show();
}
...
Also, you can use
StiDashboardViewerControl()
method to show the dashboard in the necessary place:
...
private void buttonPanel_Click(object sender, EventArgs e)
{
if (panelViewer.Controls.Count == 0)
{
ViewerControl = new StiDashboardViewerControl();
ViewerControl.Dock = DockStyle.Fill;
panelViewer.Controls.Add(ViewerControl);
}
ViewerControl.Report = GetTemplate();
}
...
На скриншоте ниже Вы можете увидеть результат выполнения данного кода: