Display SSRS RDL report in Bold Reports® Angular Report Viewer Classic
To display an already created SSRS RDL report in the Bold Reports® Angular Report Viewer Classic without using a Report Server, create an Angular CLI application, install the @boldreports/angular-reporting-components package, and set the report path and Web API service URL.
To get started quickly with the Angular Report Viewer Classic, watch the following video:
What do I need before adding the classic Report Viewer to an Angular app?
To add the Bold Reports® Angular Report Viewer Classic, your development environment needs Node JS and NPM at the versions listed below.
Before you begin, make sure your development environment includes the following:
Install the Angular CLI
To install the Angular CLI globally on your machine, run the following command in the Command Prompt. The Angular CLI tool is the easiest way to set up Angular CLI projects for the Report Viewer Classic.
npm install -g @angular/cli@latestTo learn more about
angular-clicommands, see the Angular CLI repository on GitHub.
Create a new application
To create a new Angular application, run the following command in the Command Prompt.
ng new project-name
E.g : ng new reportviewerappThe ng new command prompts you for information about features to include in the initial application project. Accept the defaults by pressing the Enter or Return key.

Configure the Bold Reports® Report Viewer Classic in Angular CLI
The Bold Reports® Angular Report Viewer Classic is distributed in the npm package @boldreports/angular-reporting-components.
-
To configure the Report Viewer Classic component, change the directory to your application’s root folder.
cd project-name E.g: cd reportviewerapp -
Run the following commands to install the Bold Reports® Angular library.
Angular version NPM package installation 12 or greater than 12 npm install @boldreports/angular-reporting-components@latest —save-dev lesser than 12 npm install @boldreports/[email protected] —save-dev Note: It is important to exercise caution during the package installation process to avoid potential complications with package compilation.
-
Also, install the Bold Reports® typings by running the following command.
npm install --save-dev @boldreports/types -
Register the
@bold-reports/typesunder thetypeRootsand add the typingsjqueryandreports.allto thetsconfig.app.jsonfile.{ ... ... "compilerOptions": { ... ... "typeRoots": [ "node_modules/@types", "node_modules/@boldreports/types" ], "types": [ "jquery", "reports.all" ] }, ... ... } -
The Report Viewer Classic requires a
window.jQueryobject to render the component.-
For
Angular version 12 or higher, create a filesrc/globals.tsand importjQueryas in the following code snippet:import * as jquery from 'jquery'; let windowInstance = (window as { [key: string]: any }); windowInstance['jQuery'] = jquery; windowInstance['$'] = jquery;- In the
src/app/app.module.tsfile, import thesrc/globals.tsfile prior to importing theBold Reportsviewer or designer component in theapp.module.ts.import './../globals';
- In the
-
For
Angular version lesser than 12, importjQueryinto thesrc/polyfills.tsfile as shown in the following code snippet:import * as jquery from 'jquery'; let windowInstance = (window as { [key: string]: any }); windowInstance['jQuery'] = jquery; windowInstance['$'] = jquery;
-
Adding CSS reference
Add the Report Viewer Classic component style (bold.reports.all.min.css) as given in the angular.json file within the projectname > styles section (For example, reportviewerapp > styles).
If you are using an Angular 6 or lower version project, add the changes to the
angular-cli.jsonfile.
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"project": {
"name": "reportviewerapp"
},
"reportviewerapp": [
{
"root": "src",
"outDir": "dist",
. . .
. . .
"styles": [
"styles.css",
"./node_modules/@boldreports/javascript-reporting-controls/Content/material/bold.reports.all.min.css"
],
"scripts": [],
. . .
. . .
}In the previous code, the
materialtheme is used. To use another theme for your application, follow this syntax:./node_modules/@boldreports/javascript-reporting-controls/Content/[theme-name]/bold.reports.all.min.css
Adding Report Viewer Classic component
To add the Report Viewer Classic component, refer to the following steps:
-
Open the
app.module.tsfile. -
Replace the code in the
app.module.tsfile with the following code snippet:import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; import { BoldReportViewerModule } from '@boldreports/angular-reporting-components'; import { AppComponent } from './app.component'; // Report viewer import '@boldreports/javascript-reporting-controls/Scripts/bold.report-viewer.min'; // data-visualization import '@boldreports/javascript-reporting-controls/Scripts/data-visualization/ej.bulletgraph.min'; import '@boldreports/javascript-reporting-controls/Scripts/data-visualization/ej.chart.min'; @NgModule({ declarations: [ AppComponent ], imports: [ BrowserModule, BoldReportViewerModule ], providers: [], bootstrap: [AppComponent] }) export class AppModule { } -
Open the
index.htmlfile and refer to the following scripts in the<head>tag.<!-- Data-Visualization --> <script src="https://cdn.boldreports.com/15.1.10/scripts/common/ej2-base.min.js"></script> <script src="https://cdn.boldreports.com/15.1.10/scripts/common/ej2-data.min.js"></script> <script src="https://cdn.boldreports.com/15.1.10/scripts/common/ej2-pdf-export.min.js"></script> <script src="https://cdn.boldreports.com/15.1.10/scripts/common/ej2-svg-base.min.js"></script> <script src="https://cdn.boldreports.com/15.1.10/scripts/data-visualization/ej2-lineargauge.min.js"></script> <script src="https://cdn.boldreports.com/15.1.10/scripts/data-visualization/ej2-circulargauge.min.js"></script> <script src="https://cdn.boldreports.com/15.1.10/scripts/data-visualization/ej2-maps.min.js"></script> -
Open the
app.component.htmlfile and initialize the Report Viewer Classic. -
Replace the code in the
app.component.htmlfile with the following code snippet:<bold-reportviewer id="reportViewer_Control" style="width: 100%;height: 950px"> </bold-reportviewer> -
Open the
app.component.tsand replace the following code example:import { Component } from '@angular/core'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'] }) export class AppComponent { title = 'reportviewerapp'; public serviceUrl: string; public reportPath: string; constructor() { // Initialize the Report Viewer Classic properties here. } }If you get the issue
'ej' is not definedafter the previous configuration in Angular CLI version 7, add the following code snippet to your application. Add it where you render the Syncfusion® Components (model file) to resolve the issue.`/// <reference types="reports.all" />`
Adding already created report
-
Create a folder
Resourcesin your Web API application to store the RDL reports and add already created reports to it. -
Add already created reports to the newly created folder.
In this tutorial, the
sales-order-detail.rdlreport is used, and you can download the sales-order-detail.rdl sample report.
Set report path and Web API service
To set the report path and the Web API service for the Angular Report Viewer Classic, open the app.component.ts file and add the following code to the constructor.
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'jsreport-sample';
public serviceUrl: string;
public reportPath: string;
constructor() {
this.serviceUrl = 'https://demos.boldreports.com/services/api/ReportViewer';
this.reportPath = '~/Resources/docs/sales-order-detail.rdl';
}
}Open the app.component.html to set the reportPath and reportServiceUrl properties of the Report Viewer Classic as in the following:
<bold-reportviewer id="reportViewer_Control" [reportServiceUrl] = "serviceUrl" [reportPath] = "reportPath" style="width: 100%;height: 950px">
</bold-reportviewer>Serve the application
To serve the application, follow these steps:
-
Navigate to the root of the application and run the application using the following command.
ng serve -
Navigate to the appropriate port
http://localhost:4200in the browser. -
Click the view option to view the demo.