|
1 | 1 | ---
|
2 | 2 | title: Methods and Commands
|
3 | 3 | page_title: Methods and Commands of the Blazor Report Viewer
|
4 |
| -description: "Learn about what are the methods and commands exposed by the Telerik Reporting Blazor Report Viewer and how to use them." |
| 4 | +description: "Learn about what the methods and commands exposed by the Telerik Reporting Blazor Report Viewer are and how to use them." |
5 | 5 | slug: telerikreporting/using-reports-in-applications/display-reports-in-applications/web-application/blazor-report-viewer/methods-and-commands
|
6 |
| -tags: methods,and,commands,blazor,report,viewer |
| 6 | +tags: methods,commands,blazor,report,viewer |
7 | 7 | published: True
|
8 | 8 | position: 3
|
9 | 9 | previous_url: /blazor-report-viewer-methods-and-commands
|
10 | 10 | ---
|
11 | 11 |
|
12 | 12 | # Methods and Commands Overview
|
13 | 13 |
|
14 |
| -The Blazor Report Viewer exposes methods and commands that allow to control its behavior from application code. |
| 14 | +The Blazor Report Viewer exposes methods and commands that allow you to control its behavior from application code. |
15 | 15 |
|
16 |
| -## Get a report viewer reference to access API |
| 16 | +## Get a report viewer reference to access the API |
17 | 17 |
|
18 |
| -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: |
| 18 | +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, a refresh and print of the current report can be triggered like this: |
19 | 19 |
|
20 |
| -````CSharp |
21 |
| -<button type="button" class="btn btn-light btn-sm" @onclick="RefreshReport">Refresh Report</button> |
22 |
| -<button type="button" class="btn btn-light btn-sm" @onclick="Print">Print Report</button> |
23 |
| -... |
24 |
| -<ReportViewer @ref="reportViewer1" |
25 |
| -... |
26 |
| -@code { |
27 |
| - ReportViewer reportViewer1; |
28 |
| - async void RefreshReport() |
29 |
| - { |
30 |
| - await reportViewer1.RefreshReportAsync(); |
31 |
| - } |
32 |
| - async void Print() |
33 |
| - { |
34 |
| - await reportViewer1.Commands.Print.ExecuteAsync(); |
35 |
| - } |
36 |
| -} |
37 |
| -```` |
| 20 | +{{source=CodeSnippets\BlazorAppSnippets\Components\Pages\MethodsCommands.razor}} |
38 | 21 |
|
0 commit comments