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.
<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.

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.