Connecting to Data from Code
Наши примеры проектов и шаблоны отчётов помогут Вам разобраться в основах работы с нашими продуктами.A report's data can be supplied and switched from Blazor code. This example loads a report and lets the user swap between two datasets.
Preparing the data. Read or create the data source, register it in the report dictionary, synchronize the schema, and render with the supplied records.
На скриншоте ниже Вы можете увидеть результат выполнения данного кода:

Preparing the data. Read or create the data source, register it in the report dictionary, synchronize the schema, and render with the supplied records.
<StiBlazorViewer Report="@Report" />
@code {
private StiReport Report;
private void SetFirstDataSet()
{
var report = this.Report.Clone() as StiReport;
report.Dictionary.Databases.Clear();
report.RegData("Demo", firstDataSet);
report.Render();
this.Report = report;
}
}The report is cloned so each dataset produces an independent document; Dictionary.Databases.Clear() drops the design-time connection and RegData registers the new data. Reassigning this.Report updates the viewer.На скриншоте ниже Вы можете увидеть результат выполнения данного кода:
