- //...
-````
-
-
-* Initialize the Telerik HTML5 Report Viewer in `viewer.component.ts`:
-
+
+ ````
+
+1. In your `report-designer.component.js(ts)`, declare jQuery and initialize the designer:
+
+ ````JavaScript
+ import { Component, OnInit } from '@angular/core';
+
+ @Component({
+ selector: 'app-report-designer',
+ templateUrl: './report-designer.component.html',
+ styleUrls: ['./report-designer.component.css']
+ })
+ export class ReportDesignerComponent {
+ constructor() {}
+
+ ngOnInit() {
+ this.designer = $("#webReportDesigner").telerik_WebReportDesigner({
+ serviceUrl: "https://localhost:5000/api/reportdesigner/", // Replace with your service URL
+ report: "SampleReport.trdp" // Replace with your report file
+ }).data("telerik_WebDesigner");
+ }
+ }
+ ````
````TypeScript
-this.viewer = $("#reportViewer").telerik_ReportViewer({
- serviceUrl: "https://demos.telerik.com/reporting/api/reports/",
- reportSource: {
- report: 'Product Sales.trdx',
- parameters: {}
- }
- }).data("telerik_ReportViewer");
-````
-
+ import { Component, OnInit } from '@angular/core';
+
+ declare var $: any;
+
+ @Component({
+ selector: 'app-report-designer',
+ templateUrl: './report-designer.component.html',
+ styleUrls: ['./report-designer.component.css']
+ })
+ export class ReportDesignerComponent implements OnInit {
+ private designer: any;
+
+ ngOnInit(): void {
+ this.designer = $("#webReportDesigner").telerik_WebReportDesigner({
+ serviceUrl: "https://localhost:5000/api/reportdesigner/", // Replace with your service URL
+ report: "SampleReport.trdp" // Replace with your report file
+ }).data("telerik_WebDesigner");
+ }
+ }
+ ````
## Additional Resources
@@ -96,20 +120,20 @@ this.viewer = $("#reportViewer").telerik_ReportViewer({
To run the example:
-````powershell
->npm install
->npm start
+````bash
+$ npm install
+$ npm start
````
## Known Issues
-Several things that you should keep in mind when using Telerik Web Report Designer in your projects.
+Keep the following limitations in mind when using the Telerik Web Report Designer in Angular:
-1.[Telerik Web Report Designer]({%slug telerikreporting/designing-reports/report-designer-tools/web-report-designer/overview%}) does not support theming. The Web Designer is built to use a customized version of the Kendo SASS Default theme. The Designer loads all styles that are required by itself. There is no additional option that could prevent it. The required styles are added to the body header of the document. If the application uses another Kendo theme, there will be conflicts between the two themes.
+1. Theming limitations—The [Telerik Web Report Designer]({%slug telerikreporting/designing-reports/report-designer-tools/web-report-designer/overview%}) does not support custom theming. It uses a customized version of the Kendo SASS Default theme that loads automatically. If your Angular application uses a different Kendo theme, style conflicts may occur between the two themes.
-1. Because the Telerik Web Report Designer loads all required styles when the designer widget is created, and in the latest version there is no check, if the resources are already loaded, you will need to clean up the duplicated resources. See `designer.component.ts` in the demo project for more details.
+1. Duplicate CSS resources—The Web Report Designer automatically loads its required CSS styles each time it is initialized, without checking if they are already present. This can result in duplicate `