Progress® Telerik® Reporting R3 2020

New to Telerik Reporting? Download free 30-day trial

Methods and Commands

The Blazor Report Viewer exposes methods and commands that allow to control its behavior from application code.

Get a report viewer reference to access API

To call report viewer methods and execute commands it is required to first get a reference to the report viewer object using the @ref attribute. Then use the reportViewer1 object to access the report viewer API. For example, refresh and print of the current report can be triggered like this:

Razor
<button type="button" class="btn btn-light btn-sm" @onclick="RefreshReport">Refresh Report</button>
<button type="button" class="btn btn-light btn-sm" @onclick="Print">Print Report</button>

...

<ReportViewer @ref="reportViewer1"
...

@code {
    ReportViewer reportViewer1;

    async void RefreshReport()
    {
        await reportViewer1.RefreshReportAsync();
    }

    async void Print()
    {
        await reportViewer1.Commands.Print.ExecuteAsync();
    }
}
In this article
Not finding the help you need?