This example shows how to create a simple dashboard at runtime.

For example, let's create a dashboard with table. First, you need to add the StiBlazorViewer component to the view page.
@using Stimulsoft.Report.Blazor;


<StiBlazorViewer Report="@report" Theme="StiViewerTheme.Office2013WhiteCarmine"></StiBlazorDesigner>


Next, create a new dashboard object - use the CreateNewDashboard() method for this. After that, read and register data:

// Create dashboard Object
report = StiReport.CreateNewDashboard();
var dashboard = report.Pages[0] as StiDashboard;

// Read data
var dataPath = Path.Combine("Data/Demo.xml");
var data = new DataSet();

// Register data


Next, create a new StiTableElement() object, specify its position, size and fill it with data:

// Create table
var tableElement = new StiTableElement();
tableElement.Left = 0;
tableElement.Top = 0;
tableElement.Width = 700;
tableElement.Height = 500;
tableElement.Name = "Example";

// Fill table
var dataBase = new StiDimensionColumn();
dataBase.Expression = "Products.ProductID";

var dataBase1 = new StiDimensionColumn();
dataBase1.Expression = "Products.ProductName";

var dataBase2 = new StiDimensionColumn();
dataBase2.Expression = "Products.UnitPrice";


Then, apply filters:

// Apply filters
var filter1 = new StiDataFilterRule();
filter1.Condition = StiDataFilterCondition.BeginningWith;
filter1.Path = "Products.ProductID";
filter1.Value = "1";

var filter2 = new StiDataFilterRule();
filter2.Condition = StiDataFilterCondition.EndingWith;
filter2.Path = "Products.UnitPrice";
filter2.Value = "1";

Finally, add table to the dashboard:

// Add table to dashboard


In the screenshot below you can see the result of the sample code:

Creating Dashboard at Runtime

By using this website, you agree to the use of cookies for analytics and personalized content. Cookies store useful information on your computer to help us improve efficiency and usability. For more information, please read the privacy policy and cookie policy.