Migrate to Report Viewer v2.0 component

To migrate your Angular application to the Bold Reports® Report Viewer v2.0 component, replace the old style and script references with the v2.0 styles and scripts in the angular.json and app.module.ts files.

How do I replace the CSS reference for v2.0?

To replace the CSS reference for the Bold Reports® Angular Report Viewer v2.0, remove the old style from the angular.json file and add the v2.0 style.

  1. Open the angular.json file.
  2. Remove the old Report Viewer component style.
    • bold.reports.all.min.css
  3. Add the v2.0 style.
    • \v2.0\tailwind-light\bold.report-viewer.min.css
  4. The final updated angular.json file looks as follows:

If you are using an Angular 6 or lower version project, add the changes to the angular-cli.json file.

{
  "$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/v2.0/tailwind-light/bold.report-viewer.min.css"
      ],
      "scripts": [],
       . . .
       . . .
      }

How do I replace the Report Viewer scripts for v2.0?

To replace the scripts for the Bold Reports® Angular Report Viewer v2.0, remove the old script imports from the app.module.ts file and import the v2.0 scripts.

  1. Open the app.module.ts file.

  2. Remove the old Report Viewer component scripts.

    • bold.report-viewer.min
    • ej.bulletgraph.min
    • ej.chart.min
  3. Add the v2.0 scripts.

    • \v2.0\common\bold.reports.common.min
    • \v2.0\common\bold.reports.widgets.min
    • \v2.0\bold.report-viewer.min.css
  4. The final updated app.module.ts file looks as follows:

    import { BrowserModule } from '@angular/platform-browser';
    import { NgModule } from '@angular/core';
    import { BoldReportViewerModule } from '@boldreports/angular-reporting-components';
    import { AppComponent } from './app.component';
    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';
    
    import '@boldreports/javascript-reporting-controls/Scripts/v2.0/bold.report-viewer.min';
    
    @NgModule({
      declarations: [
        AppComponent
      ],
    imports: [
        BrowserModule,
        BoldReportViewerModule
      ],
      providers: [],
      bootstrap: [AppComponent]
    })
    export class AppModule { }

See also