Embed Bold Reports® Report Server Report
To embed the Bold Reports® Angular Report Designer with Report Server, set the serviceUrl, serviceAuthorizationToken and reportServerUrl properties. You can then create, edit, browse, and publish reports using the Report Server built-in API service.
Follow these steps to integrate Report Server with Bold Reports® Designer version higher than
v5.2.xx
In Angular version
20.xand above, certain filenames have been updated. For example, the file previously namedapp.component.tsis now renamed toapp.ts.
Prerequisites
Before getting started with the Bold Reports® Angular Report Designer, ensure that your development environment includes the following:
- Node JS (
version 20.x or 22.x and above) Version Compatibility. - NPM (
v10.x.x or higher)
Install the Angular CLI
To install the Angular CLI globally on your machine for the Report Designer application, run the following command in Command Prompt. The Angular CLI provides the easiest way to set up Angular projects.
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 for the Report Designer, run the following command in Command Prompt.
ng new project-name
E.g : ng new reportdesignerappThe
ng newcommand prompts you for information about features to include in the initial application project. Add theAngular Routingto your angular application by enteringyin the prompt window then press Enter key. Now, choose theCSSstylesheet format using the arrow keys and then press Enter key. The Angular CLI installs the required Angular npm packages and other dependencies.
Configure Bold Reports® Report Designer in Angular CLI
The Bold Reporting packages are distributed in npm as @boldreports/angular-reporting-components.
-
To configure the web Report Designer component, change the directory to your application’s root folder.
cd project-name E.g : cd reportdesignerapp -
Run the following commands to install the Bold Reports® Angular library.
npm install @boldreports/angular-reporting-components --save-dev -
Install the typings dependencies
jquery,types/jqueryandboldreports/types.npm install --save-dev jquery npm install --save-dev @types/jquery npm install --save-dev @boldreports/types -
Refer the jQuery script file (
jquery.js) as given in theangular.jsonfile within theprojectname > scriptssection (For example,reportdesignerapp > scripts).{ "$schema": "./node_modules/@angular/cli/lib/config/schema.json", "projects": { "reportdesignerapp": { "root": "src", "outDir": "dist", . . . . . . "styles": [ "src/styles.css" ], "scripts": [ "./node_modules/jquery/dist/jquery.js" ], . . . . . . } } } -
Add the typings
jquery, andreports.allto thetsconfig.app.jsonfile.{ ... ... "compilerOptions": { ... ... "types": [ "jquery", "reports.all" ] }, ... ... } -
Register the
@bold-reports/typesunder thetypeRootsnode in thetsconfig.jsonfile.
Adding CSS reference
-
Open the
angular.jsonfile from your application’s root directory. -
Refer the web Report Designer component style scripts
bold.report-designer.min.cssunder thestylesnode ofprojectssection as in the following code example:{ "$schema": "./node_modules/@angular/cli/lib/config/schema.json", "projects": { "reportdesignerapp": { "root": "src", "outDir": "dist", . . . . . . "styles": [ "src/styles.css", "./node_modules/@boldreports/javascript-reporting-controls/Content/v2.0/tailwind-light/bold.report-designer.min.css" ], "scripts": [], . . . . . . } } }In the preceding code snippet, the
tailwind-lighttheme is used. You can modify the theme based on your application, refer the following syntax:./node_modules/@boldreports/javascript-reporting-controls/Content/v2.0/[theme-name]/bold.report-designer.min.css.
Adding code mirror reference
The Bold Reports® Angular Report Designer requires the code mirror scripts and styles to edit the SQL queries and Visual Basic code functions with a syntax highlighter.
-
Run the following command to install the code mirror dependencies.
npm install codemirror@5.45.0 -
Open the
angular.jsonfile from your application’s root directory and refer the code mirror scripts and styles under thescriptsandstylesnodes of theprojectssection as in the following code example:{ "$schema": "./node_modules/@angular/cli/lib/config/schema.json", "projects": { "reportdesignerapp": { "root": "src", "outDir": "dist", . . . . . . "styles": [ "src/styles.css", "./node_modules/@boldreports/javascript-reporting-controls/Content/v2.0/tailwind-light/bold.report-designer.min.css", "./node_modules/codemirror/lib/codemirror.css", "./node_modules/codemirror/addon/hint/show-hint.css" ], "scripts": [ "./node_modules/codemirror/lib/codemirror.js", "./node_modules/codemirror/addon/hint/show-hint.js", "./node_modules/codemirror/addon/hint/sql-hint.js", "./node_modules/codemirror/mode/sql/sql.js", "./node_modules/codemirror/mode/vb/vb.js", "./node_modules/jquery/dist/jquery.js" ], . . . . . . } } }
Adding Report Designer component
To add the Bold Reports® Angular Report Designer component, use the following steps:
-
Open the
app.tsorapp.component.tsfile. -
You can replace the following code snippet in the
app.tsorapp.component.tsfile.import { Component } from '@angular/core'; import { CommonModule } from '@angular/common'; import { BoldReportDesignerModule } from '@boldreports/angular-reporting-components'; //Report Designer component dependent scripts import '@boldreports/javascript-reporting-controls/Scripts/v2.0/common/bold.reports.common.min'; import '@boldreports/javascript-reporting-controls/Scripts/v2.0/common/bold.reports.widgets.min'; //Report Viewer and Designer component scripts import '@boldreports/javascript-reporting-controls/Scripts/v2.0/bold.report-viewer.min'; import '@boldreports/javascript-reporting-controls/Scripts/v2.0/bold.report-designer.min'; @Component({ selector: 'app-root', imports: [CommonModule, BoldReportDesignerModule], templateUrl: './app.html', // or app.component.html styleUrls: ['./app.css'] // or app.component.css }) export class AppComponent { public serviceUrl: string; constructor() { // Initialize the Report designer properties here. } } -
Open the
app.htmlorapp.component.htmlfile and initialize the web Report Designer. -
You can replace the following code snippet in the
app.htmlorapp.component.htmlfile.<bold-reportdesigner id="designer" style="position: absolute;height: 550px; width: 1250px;"> </bold-reportdesigner>
How do I configure Report Server for the Report Designer?
To configure Bold Reports® Report Server for the Angular Report Designer, set the serviceUrl, serviceAuthorizationToken and reportServerUrl values from your Report Server.
The Report Designer requires the serviceAuthorizationToken, serviceUrl, and reportServerUrl to perform the API actions with Bold Reports® Report Server. You can provide the information from Report Server as follows:
serviceUrl– Report Server Reporting Service information should be provided for this API.serviceAuthorizationToken– Authorization token to communicate with reportServiceUrl.reportServerUrl- Report Server Reporting Server information should be provided for this API.
Open the app.html or app.component.html and set the Bold Reports® Report Server built-in service URL to the serviceUrl and reportServerUrl properties and assign the created token to serviceAuthorizationToken property, as shown in the following code example:
<bold-reportdesigner
id="reportDesigner_Control"
[serviceUrl]="serviceUrl"
[reportServerUrl]="reportServerUrl"
[serviceAuthorizationToken] = "serverServiceAuthorizationToken" style="position: absolute;height: 550px; width: 1250px;">
</bold-reportdesigner>Based on the type of Report Server, you can use one of the procedures listed as follows:
Enterprise Reporting Server
-
Generate token with your user credentials and assign it to serviceAuthorizationToken. To generate the token by using credentials, refer to Generate an authentication token by using credentials.
import { Component } from '@angular/core'; import { CommonModule } from '@angular/common'; import { BoldReportDesignerModule } from '@boldreports/angular-reporting-components'; //Report Designer component dependent scripts import '@boldreports/javascript-reporting-controls/Scripts/v2.0/common/bold.reports.common.min'; import '@boldreports/javascript-reporting-controls/Scripts/v2.0/common/bold.reports.widgets.min'; //Report Viewer and Designer component scripts import '@boldreports/javascript-reporting-controls/Scripts/v2.0/bold.report-viewer.min'; import '@boldreports/javascript-reporting-controls/Scripts/v2.0/bold.report-designer.min'; @Component({ selector: 'app-root', imports: [CommonModule, BoldReportDesignerModule], templateUrl: './app.html', // or app.component.html styleUrls: ['./app.css'] // or app.component.css }) export class AppComponent { public serverServiceAuthorizationToken: string; constructor() { this.serverServiceAuthorizationToken = 'bearer <server-token>'; } }To generate the token within an application, refer to Generate an authentication token by using the embed secret key API.
-
Set the Bold Reports® Report Server built-in service URL to the
serviceUrlproperty. TheserviceUrlproperty value should be in format ofhttps://<<Report server name>>/reporting/reportservice/api/Designer.import { Component } from '@angular/core'; import { CommonModule } from '@angular/common'; import { BoldReportDesignerModule } from '@boldreports/angular-reporting-components'; //Report Designer component dependent scripts import '@boldreports/javascript-reporting-controls/Scripts/v2.0/common/bold.reports.common.min'; import '@boldreports/javascript-reporting-controls/Scripts/v2.0/common/bold.reports.widgets.min'; //Report Viewer and Designer component scripts import '@boldreports/javascript-reporting-controls/Scripts/v2.0/bold.report-viewer.min'; import '@boldreports/javascript-reporting-controls/Scripts/v2.0/bold.report-designer.min'; @Component({ selector: 'app-root', imports: [CommonModule, BoldReportDesignerModule], templateUrl: './app.html', // or app.component.html styleUrls: ['./app.css'] // or app.component.css }) export class AppComponent { public serviceUrl: string; public serverServiceAuthorizationToken: string; public reportServerUrl: string; constructor() { this.serviceUrl ='https://<your-report-server-domain>/reporting/reportservice/api/Designer'; this.serverServiceAuthorizationToken = 'bearer <server-token>'; } } -
Set the Bold Reports® Report Server built-in server URL to the
reportServerUrlproperty. ThereportServerUrlproperty value should be in format ofhttps://<<Report server name>>/reporting/api/site/<<site name>>. You can use the following complete code in yourapp.tsorapp.component.tsfile.import { Component } from '@angular/core'; import { CommonModule } from '@angular/common'; import { BoldReportDesignerModule } from '@boldreports/angular-reporting-components'; //Report Designer component dependent scripts import '@boldreports/javascript-reporting-controls/Scripts/v2.0/common/bold.reports.common.min'; import '@boldreports/javascript-reporting-controls/Scripts/v2.0/common/bold.reports.widgets.min'; //Report Viewer and Designer component scripts import '@boldreports/javascript-reporting-controls/Scripts/v2.0/bold.report-viewer.min'; import '@boldreports/javascript-reporting-controls/Scripts/v2.0/bold.report-designer.min'; @Component({ selector: 'app-root', imports: [CommonModule, BoldReportDesignerModule], templateUrl: './app.html', // or app.component.html styleUrls: ['./app.css'] // or app.component.css }) export class AppComponent { public serviceUrl: string; public serverServiceAuthorizationToken: string; public reportServerUrl: string; constructor() { this.reportServerUrl = 'https://<your-report-server-domain>/reporting/api/site/<site-name>'; this.serviceUrl ='https://<your-report-server-domain>/reporting/reportservice/api/Designer'; this.serverServiceAuthorizationToken = 'bearer <server-token>'; } }
Cloud Reporting server
-
Generate token with your user credentials and assign it to serviceAuthorizationToken. To generate the token by using credentials, refer to Generate an authentication token by using credentials.
import { Component } from '@angular/core'; import { CommonModule } from '@angular/common'; import { BoldReportDesignerModule } from '@boldreports/angular-reporting-components'; //Report Designer component dependent scripts import '@boldreports/javascript-reporting-controls/Scripts/v2.0/common/bold.reports.common.min'; import '@boldreports/javascript-reporting-controls/Scripts/v2.0/common/bold.reports.widgets.min'; //Report Viewer and Designer component scripts import '@boldreports/javascript-reporting-controls/Scripts/v2.0/bold.report-viewer.min'; import '@boldreports/javascript-reporting-controls/Scripts/v2.0/bold.report-designer.min'; @Component({ selector: 'app-root', imports: [CommonModule, BoldReportDesignerModule], templateUrl: './app.html', // or app.component.html styleUrls: ['./app.css'] // or app.component.css }) export class AppComponent { public serviceUrl: string; public serverServiceAuthorizationToken: string; public reportServerUrl: string; constructor() { this.serverServiceAuthorizationToken = 'bearer <server-token>'; }; }To generate the token within an application, refer to Generate an authentication token by using the embed secret key API.
-
Set the Bold Reports® Report Server built-in service URL to the
serviceUrlproperty. TheserviceUrlproperty value is ahttps://service.boldreports.com/api/Designer.import { Component } from '@angular/core'; import { CommonModule } from '@angular/common'; import { BoldReportDesignerModule } from '@boldreports/angular-reporting-components'; //Report Designer component dependent scripts import '@boldreports/javascript-reporting-controls/Scripts/v2.0/common/bold.reports.common.min'; import '@boldreports/javascript-reporting-controls/Scripts/v2.0/common/bold.reports.widgets.min'; //Report Viewer and Designer component scripts import '@boldreports/javascript-reporting-controls/Scripts/v2.0/bold.report-viewer.min'; import '@boldreports/javascript-reporting-controls/Scripts/v2.0/bold.report-designer.min'; @Component({ selector: 'app-root', imports: [CommonModule, BoldReportDesignerModule], templateUrl: './app.html', // or app.component.html styleUrls: ['./app.css'] // or app.component.css }) export class AppComponent { public serviceUrl: string; public serverServiceAuthorizationToken: string; public reportServerUrl: string; constructor() { this.serviceUrl ='https://service.boldreports.com/api/Designer'; this.serverServiceAuthorizationToken = 'bearer <server-token>'; }; } -
Set the Bold Reports® Report Server built-in server URL to the
reportServerUrlproperty. ThereportServerUrlproperty value should be in format ofhttps://<<Report server name>>/reporting/api/. You can use the following complete code in yourapp.tsorapp.component.tsfile.import { Component } from '@angular/core'; import { CommonModule } from '@angular/common'; import { BoldReportDesignerModule } from '@boldreports/angular-reporting-components'; //Report Designer component dependent scripts import '@boldreports/javascript-reporting-controls/Scripts/v2.0/common/bold.reports.common.min'; import '@boldreports/javascript-reporting-controls/Scripts/v2.0/common/bold.reports.widgets.min'; //Report Viewer and Designer component scripts import '@boldreports/javascript-reporting-controls/Scripts/v2.0/bold.report-viewer.min'; import '@boldreports/javascript-reporting-controls/Scripts/v2.0/bold.report-designer.min'; @Component({ selector: 'app-root', imports: [CommonModule, BoldReportDesignerModule], templateUrl: './app.html', // or app.component.html styleUrls: ['./app.css'] // or app.component.css }) export class AppComponent { public serviceUrl: string; public serverServiceAuthorizationToken: string; public reportServerUrl: string; constructor() { this.reportServerUrl = 'https://<your-report-server-domain>/reporting/api/'; this.serviceUrl ='https://service.boldreports.com/api/Designer'; this.serverServiceAuthorizationToken = 'bearer <server-token>'; }; }
Serve the application
To serve the Angular Report Designer application, run the ng serve command from the workspace folder.
-
Go to the workspace folder (reportdesignerapp).
-
Launch the server by using the CLI command ng serve, with the —open option.
ng serve --open -
The
ng servecommand launches the server and the--openoption automatically opens your browser tohttp://localhost:4200/.