# ActiveReportsJS Report Viewer Wrapper for Angular

Learn how to use ActiveReportsJS Report Viewer wrapper for Angular

## Content

This page provides a detailed overview of ActiveReportsJS Report Viewer Wrapper for Angular. You can check the [Get Started](/activereportsjs/docs/v6.1/GettingStarted/QuickStart/QuickStart-Angular) tutorial for a concise guide for integrating this wrapper into an Angular application.

### ActiveReportsJS Angular NPM package

We distribute the library that contains ActiveReportsJS Report Viewer Wrapper for Angular component via the [@mescius/activereportsjs-angular](https://www.npmjs.com/package/@mescius/activereportsjs-angular) npm package. The main [@mescius/activereportsjs](https://www.npmjs.com/package/@mescius/activereportsjs) package provides the core functionality.

### ActiveReportsJS Angular Module

ActiveReportsJS Report Viewer Wrapper for Angular resides in the `ActiveReportsModule` Angular module, so it should be imported to the application's root module or other module that is intended to use ActiveReportsJs Report Viewer, for example:

```javascript
import { BrowserModule } from "@angular/platform-browser";
import { NgModule } from "@angular/core";
import { ActiveReportsModule } from "@mescius/activereportsjs-angular";

import { AppComponent } from "./app.component";

@NgModule({
  declarations: [AppComponent],
  imports: [BrowserModule, ActiveReportsModule],
  providers: [],
  bootstrap: [AppComponent],
})
export class AppModule {}
```

### ActiveReportsJS Angular Viewer Component

The ActiveReportsJS Angular Viewer Component can be referenced in HTML with `gc-activereports-viewer` tag. You can use the following input properties of the Viewer Component to set its appearance.

| Property | Type | Default Value | Description |
| -------- | ---- | ------------- | ----------- |
| language | string |  | sets the language of ViewerComponent interface. Check [Localization](/activereportsjs/docs/v6.1/DeveloperGuide/ActiveReportsJSViewer/Localization) page for more information |
| panelsLocation | 'sidebar' \| 'toolbar' | 'sidebar' | sets the location of Search and Export UI |
| exportsSettings | Object |  | sets the export settings. Check the [Export Settings](/activereportsjs/docs/v6.1/DeveloperGuide/ActiveReportsJSViewer/Export/Export-Settings) page for more information |
| availableExports | Array of strings | [] | sets the list of export filters that should be available for a user. Check [ActiveReportJS Export Services section](/activereportsjs/docs/v6.1/DeveloperGuide/ActiveReportsJSViewer/Integration/Angular-Component#activereportjs-export-services) for more information. |
| mouseMode | 'Pan' \| 'Selection' | Pan | sets the mouse mode of ViewerComponent. |
| renderMode | 'Galley' \| 'Paginated' | Paginated | sets the render mode of ViewerComponent |
| viewMode | 'Continuous' \| 'SinglePage' | Continuous | sets the mode of displaying a multi-page report |
| zoom | 'FitWidth' \| 'FitPage' \| number | 100 | sets the zoom level of displayed pages |
| fullscreen | boolean | false | ViewerComponent is displayed in FullScreen mode if this property is set to `true` |
| toolbarVisible | boolean | true | sets visibility of the toolbar of ViewerComponent |
| sidebarVisible | boolean | true | sets visibility of the sidebar of ViewerComponent |
| errorHandler | function | null | the callback that invoked if the error occurs in ViewerComponent |
| showParametersOnOpen | 'auto'\|'always' | 'auto' | the `auto` value indicates that the `Parameters Panel` should open automatically upon report loading, even if the report's parameters have default values. |
| animations | AnimationSettings |  | Specifies the animation configuration | 
| themeConfig | UIThemeConfig |  | Specifies the theme configuration | 
| theme | ColorTheme or built-in theme ID |  | Specifies the active theme | 

You can bind these input properties to dynamic values to completely overwrite the viewer component's default UI, check [Customization page](/activereportsjs/docs/v6.1/DeveloperGuide/ActiveReportsJSViewer/Customization) for more information.
In addition, the ViewerComponent exposes the following output properties:

| Event | Parameters | Description |
| ----- | ---------- | ----------- |
| init |  | occurs when ViewerComponent is loaded |
| reportLoaded | [ReportLoadEventArgs](https://developer.mescius.com/activereportsjs/api/modules/ReportViewer#reportloadeventargs) | occurs when a report is loaded in the ViewerComponent before rendering is started |
| documentLoaded | [DocumentLoadEventArgs](https://developer.mescius.com/activereportsjs/api/modules/ReportViewer#documentloadeventargs) | occurs when a report rendering completes |

Finally, the parent component can access [methods and properties of the Viewer Class instance](https://developer.mescius.com/activereportsjs/api/classes/ReportViewer.Viewer) using `ViewChild` injection.

```javascript
@ViewChild(ViewerComponent, { static: false }) reportViewer: ViewerComponent;
```

### ActiveReportJS Export Services

ActiveReportJS Angular Module includes services that allow exporting a report to PDF, Tabular Data, or HTML format. You have to inject these services in the viewer's host component or its module or the application's root module. Here is an example of code that injects export services in the root module

```javascript
import {  AR_EXPORTS,  PdfExportService,  HtmlExportService,  TabularDataExportService} from "@mescius/activereportsjs-angular";
@NgModule({
  declarations: [AppComponent],
  imports: [BrowserModule, ActiveReportsModule],
  providers: [    {
    provide: AR_EXPORTS,
    useClass: PdfExportService,
    multi: true
  },
  {
    provide: AR_EXPORTS,
    useClass: HtmlExportService,
    multi: true
  },
  {
    provide: AR_EXPORTS,
    useClass: TabularDataExportService,
    multi: true
  }
],
  bootstrap: [AppComponent]
})
export class AppModule {}
```

Also, you can use `availableExports` input property of ViewerComponent to restrict the list of available exports. Perhaps for some reports, it's desirable to leave PDF export only in the user interface.

### Related Links

* [Live demo](/activereportsjs/demos/features/viewer-integration/angular)
* [Customization](/activereportsjs/docs/v6.1/DeveloperGuide/ActiveReportsJSViewer/Customization)
* [Localization](/activereportsjs/docs/v6.1/DeveloperGuide/ActiveReportsJSViewer/Localization)
* [Print](/activereportsjs/docs/v6.1/DeveloperGuide/ActiveReportsJSViewer/Print)
* [Export](/activereportsjs/docs/v6.1/DeveloperGuide/ActiveReportsJSViewer/Export)
* [Themes](/activereportsjs/docs/v6.1/DeveloperGuide/ActiveReportsJSViewer/Themes)