A whole report — pages, bands and components — can be assembled in code, without a pre-designed .mrt template.

Register the data. Load a data source and synchronize the dictionary so fields become available to the report:
var report = new StiReport();

var dataSet = StiJsonToDataSetConverterV2.GetDataSetFromFile(@"Data\Demo.json");
report.RegData(dataSet);
report.Dictionary.Synchronize();
Build the page structure. Add bands to the page and text components to the bands. Expressions in braces are evaluated per row:
var page = report.Pages[0];

var headerBand = new StiHeaderBand { Height = 0.5, Name = "HeaderBand" };
page.Components.Add(headerBand);
headerBand.Components.Add(new StiText(new RectangleD(0, 0, 5, 0.5)) { Text = "CompanyName" });

var dataBand = new StiDataBand { DataSourceName = "Customers", Height = 0.5, Name = "DataBand" };
page.Components.Add(dataBand);
dataBand.Components.Add(new StiText(new RectangleD(0, 0, 5, 0.5)) { Text = "{Line}.{Customers.CompanyName}" });
Show the result.
report.Show();

How it works. The band tree you build in code is exactly what the designer would produce, so the report renders, prints and exports the same as a template-based one.

Используя этот сайт, вы соглашаетесь на использование файлов Cookie для аналитики и персонализированного контента. Файлы Cookie хранят полезную информацию на вашем компьютере, чтобы помочь нам повысить эффективность и удобство использования. Для получения дополнительной информации, пожалуйста, прочтите Конфиденциальность и Использование Cookie.