Creating Report at Runtime
Our sample projects and report templates can help you learn the basics of working with our products.Build the report in .NET 8.0 from code by creating its structure and configuring the required components.
Preparing data. Register the data and synchronize the dictionary:
Adding bands and components. Create bands and text components and add them to the page:
Every element you would place in the designer has a corresponding class, so a report can be generated fully dynamically based on run-time conditions.
Preparing data. Register the data and synchronize the dictionary:
var report = new StiReport();
var dataSet = StiJsonToDataSetConverterV2.GetDataSetFromFile(@"Data\Demo.json");
report.RegData(dataSet);
report.Dictionary.Synchronize();
var page = report.Pages[0];Adding bands and components. Create bands and text components and add them to the page:
var headerBand = new StiHeaderBand();
var headerText = new StiText(new RectangleD(0, 0, 5, 0.5));
headerText.HorAlignment = StiTextHorAlignment.Center;
headerText.Brush = new StiSolidBrush(Color.LightGreen);
headerBand.Components.Add(headerText);
var dataBand = new StiDataBand();
dataBand.Components.Add(new StiText(new RectangleD(0, 0, 5, 0.5)));
page.Components.Add(headerBand);
page.Components.Add(dataBand);
report.ShowWithWpf();Every element you would place in the designer has a corresponding class, so a report can be generated fully dynamically based on run-time conditions.