Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a4c1442

Browse filesBrowse files
Update how-to-use-blazor-report-viewer.md
1 parent 32d3c3f commit a4c1442
Copy full SHA for a4c1442

File tree

Expand file treeCollapse file tree

1 file changed

+6
-68
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-68
lines changed

‎embedding-reports/display-reports-in-applications/web-application/blazor-report-viewer/how-to-use-blazor-report-viewer.md

Copy file name to clipboardExpand all lines: embedding-reports/display-reports-in-applications/web-application/blazor-report-viewer/how-to-use-blazor-report-viewer.md
+6-68Lines changed: 6 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -41,96 +41,34 @@ If you wish to connect the Report Viewer to a Report Server instance, refer to t
4141

4242
1. Add JavaScript dependencies to the `head` element of the `Pages/_Host.cshtml` (Blazor Server) or `wwwroot/index.html` (Blazor WebAssembly), or `Components/App.razor` (Blazor Web App):
4343

44-
````HTML
45-
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
46-
@* For Reports service hosted in the same project: *@
47-
<script src="/api/reports/resources/js/telerikReportViewer"></script>
48-
@* For Reports service hosted in another application / Report Server use absolute URI: *@
49-
@*<script src="https://demos.telerik.com/report-server/api/reports/resources/js/telerikReportViewer"></script>*@
50-
````
51-
44+
{{source=CodeSnippets\BlazorAppSnippets\wwwroot\JavaScriptDependencies.html}}
5245

5346
1. Add [Telerik Kendo UI SASS-Based Themes](https://docs.telerik.com/kendo-ui/styles-and-layout/sass-themes/overview) to the `head` element of the `Pages/_Host.cshtml` (Blazor Server) or `wwwroot/index.html` (Blazor WebAssembly), or `Components/App.razor` (Blazor Web App). The Razor syntax for a server application differs, and you need to escape the __@__ symbol as __@@__:
5447

55-
````HTML
56-
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/{{kendosubsetversion}}/styles/kendo.default-main.min.css" />
57-
````
48+
{{source=CodeSnippets\BlazorAppSnippets\wwwroot\KendoSassTheme.html}}
5849

5950
Alternatively, you can use the [Kendo UI LESS-Based Themes](https://docs.telerik.com/kendo-ui/styles-and-layout/less-themes/overview) (Kendo UI LESS-Based Themes are not compatible with Telerik UI for Blazor and should not be used together):
6051

61-
````HTML
62-
<link href="https://kendo.cdn.telerik.com/{{kendosubsetversion}}/styles/kendo.common.min.css" rel="stylesheet" />
63-
<link href="https://kendo.cdn.telerik.com/{{kendosubsetversion}}/styles/kendo.blueopal.min.css" rel="stylesheet" />
64-
````
65-
52+
{{source=CodeSnippets\BlazorAppSnippets\wwwroot\KendoLessTheme.html}}
6653

6754
1. Add the dedicated `interop.js` dependency at the end of the `body` element of the `Pages/_Host.cshtml` (Blazor Server) or `wwwroot/index.html` (Blazor WebAssembly), or `Components/App.razor` (Blazor Web App):
6855

69-
````HTML
70-
<script src="_content/Telerik.ReportViewer.Blazor/interop.js" defer></script>
71-
@* Or this one if using the Telerik.ReportViewer.Blazor.Trial package *@
72-
@*<script src="_content/Telerik.ReportViewer.Blazor.Trial/interop.js" defer></script>*@
73-
````
74-
56+
{{source=CodeSnippets\BlazorAppSnippets\wwwroot\InteropDependency.html}}
7557

7658
1. If using the Telerik Reporting web service (either locally hosted or in another application), use the following snippet to place the viewer component in a Razor page like `Pages/Index.razor`.
7759

7860
>note When referencing the Reports service from another application, the `ServiceUrl` setting should be the absolute URI to the service. Please remember to set the actual `ReportSource` along with the eventual parameters:
7961

80-
````CSHTML
81-
@page "/"
82-
@* For Blazor Web Apps, an interactive render mode should be used, for example: *@
83-
@* @rendermode InteractiveServer *@
84-
@using Telerik.ReportViewer.Blazor
85-
<style>
86-
#rv1 {
87-
position: relative;
88-
width: 1200px;
89-
height: 600px;
90-
}
91-
</style>
92-
<ReportViewer ViewerId="rv1"
93-
ServiceUrl="/api/reports"
94-
ReportSource="@(new ReportSourceOptions()
95-
{
96-
Report = "YOUR_REPORT_HERE.trdp"
97-
})"
98-
Parameters="@(new ParametersOptions { Editors = new EditorsOptions { MultiSelect = EditorType.ComboBox, SingleSelect = EditorType.ComboBox } })"
99-
ScaleMode="@(ScaleMode.Specific)"
100-
Scale="1.0" />
101-
````
102-
62+
{{source=CodeSnippets\BlazorAppSnippets\Components\Pages\ViewerRestService.razor}}
10363

10464
1. If displaying reports from a Report Server instance, use the following snippet to place the viewer component in a Razor page like `Pages/Index.razor`. Please remember to set the actual `ReportServer` and `ReportSource` settings:
10565

106-
````CSHTML
107-
@page "/"
108-
@* For Blazor Web Apps, an interactive render mode should be used, for example: *@
109-
@* @rendermode InteractiveServer *@
110-
@using Telerik.ReportViewer.Blazor
111-
<style>
112-
#rv1 {
113-
position: relative;
114-
width: 1200px;
115-
height: 600px;
116-
}
117-
</style>
118-
<ReportViewer ViewerId="rv1"
119-
ReportServer="@(new ReportServerOptions { Url = "https://demos.telerik.com/report-server/", Username = "demouser", Password = "demopass" })"
120-
ReportSource="@(new ReportSourceOptions()
121-
{
122-
Report = "Published/Dashboard"
123-
})"
124-
ScaleMode="@(ScaleMode.Specific)"
125-
Scale="1.0" />
126-
````
127-
66+
{{source=CodeSnippets\BlazorAppSnippets\Components\Pages\ViewerReportServer.razor}}
12867

12968
1. Use the rest of the parameters exposed on the Blazor viewer component to set up its appearance and behavior as desired.
13069

13170
1. Finally, run the project to see the rendered report.
13271

133-
13472
## See Also
13573

13674
* [Blazor Integration with Telerik Reporting](https://docs.telerik.com/blazor-ui/integrations/reporting) documentation article.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.