A dashboard can be built entirely in code — the page, a table element, its dimension columns and filters — with no designed template.

Create the dashboard and register data.
var report = StiReport.CreateNewDashboard();
var dashboard = report.Pages[0] as StiDashboard;

var data = new DataSet();
data.ReadXml(Path.Combine(appPath, "Data/Demo.xml"));
report.RegData(data);
report.Dictionary.Synchronize();
Add a table element with columns and filters.
var table = new StiTableElement {
    Left = 0, Top = 0, Width = 700, Height = 500,
    Border = { Side = StiBorderSides.All }, BackColor = Color.LightGray, Name = "Example" };
table.Columns.Add(new StiDimensionColumn { Expression = "Products.ProductName" });
table.Columns.Add(new StiDimensionColumn { Expression = "Products.UnitPrice" });
table.DataFilters.Add(new StiDataFilterRule {
    Condition = StiDataFilterCondition.BeginningWith, Path = "Products.ProductID", Value = "1" });

dashboard.Components.Add(table);

How it works. Building the element tree in code is equivalent to designing it visually, so the dashboard renders identically to a template-based one.

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.