8000 Update providing-custom-templates.md · telerik/reporting-docs@e8c143d · GitHub
[go: up one dir, main page]

Skip to content

Commit e8c143d

Browse files
Update providing-custom-templates.md
1 parent e6d71a1 commit e8c143d

File tree

1 file changed

+3
-33
lines changed
  • embedding-reports/display-reports-in-applications/web-application/html5-report-viewer/customizing/styling-and-appearance

1 file changed

+3
-33
lines changed

embedding-reports/display-reports-in-applications/web-application/html5-report-viewer/customizing/styling-and-appearance/providing-custom-templates.md

Lines changed: 3 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -17,45 +17,15 @@ The article elaborates on how to use a customized HTML template for the HTML5 Re
1717
1818
If you have a custom HTML template, you should provide it to the `telerik_ReportViewer` plugin’s options:
1919

20-
````JavaScript
21-
$("#reportViewer1").telerik_ReportViewer({
22-
serviceUrl: "../api/reports/",
23-
templateUrl: '/ReportViewer/templates/telerikReportViewerTemplate.html',
24-
reportSource: { report: "product catalog.trdp" }
25-
});
26-
````
20+
{{source=CodeSnippets\BlazorAppSnippets\wwwroot\customize\AddTemplate.html}}
2721

2822
The HTML template file is an HTML page, while the templates are HTML document fragments inside HTML5 __template__ elements:
2923

30-
````HTML
31-
<!DOCTYPE html>
32-
<html xmlns="http://www.w3.org/1999/xhtml">
33-
<head>
34-
<title>Telerik HTML5 Report Viewer Templates</title>
35-
</head>
36-
<body>
37-
<template id="trv-report-viewer">
38-
<div class="trv-report-viewer" >
39-
...
40-
</div>
41-
</template>
42-
</body>
43-
</html>
44-
````
24+
{{source=CodeSnippets\BlazorAppSnippets\wwwroot\customize\HtmlTemplate.html}}
4525

4626
The templates are loaded during the initialization of the __telerik_ReportViewer__ widget. Since this is an asynchronous network operation(the template HTML is loaded with an HTTP GET request) that takes an unpredictable amount of time, the widget is not operational until it is successful; to find when the viewer is completely loaded, provide a callback function to the __telerik_ReportViewer__ widget:
4727

48-
````JavaScript
49-
$("#reportViewer1").telerik_ReportViewer({
50-
serviceUrl: "../api/reports/",
51-
templateUrl: '/ReportViewer/templates/telerikReportViewerTemplate',
52-
reportSource: { report: "product catalog.trdp" },
53-
ready: function() {
54-
// report viewer is now ready for action
55-
}
56-
});
57-
````
58-
28+
{{source=CodeSnippets\BlazorAppSnippets\wwwroot\customize\AddTemplateAndReadyEvent.html}}
5929

6030
## See Also
6131

0 commit comments

Comments
 (0)
0