Angular component for rendering SSRS reports
npm install ngx-ssrs-reportviewer-v2
Installation ·
Usage ·
Attributes ·
Examples ·
Limitations
bash
npm install ngx-ssrs-reportviewer-v2 --save
`
⏳ Versions
| Angular Version | ReportViewer Version | Install Command |
| :-------------: | :------------------: | :-------------------------------------- |
| 10 | 10 | npm install ngx-ssrs-reportviewer-v2@10 |
| 11 | 11 | npm install ngx-ssrs-reportviewer-v2@11 |
| 12 | 12 | npm install ngx-ssrs-reportviewer-v2@12 |
| 13 | 13 | npm install ngx-ssrs-reportviewer-v2@13 |
| 14 | 14 | npm install ngx-ssrs-reportviewer-v2@14 |
| 15 | 15 | npm install ngx-ssrs-reportviewer-v2@15 |
| 16 | 16 | npm install ngx-ssrs-reportviewer-v2@16 |
| 17 | 17 | npm install ngx-ssrs-reportviewer-v2@17 |
| 18 | 18 | npm install ngx-ssrs-reportviewer-v2@18 |
| 19 | 19 | npm install ngx-ssrs-reportviewer-v2@19 |
| 20 | 20 | npm install ngx-ssrs-reportviewer-v2@20 |
| 21 | 21 | npm install ngx-ssrs-reportviewer-v2@21 |
👨🏻🏫 Usage
1. Add ReportViewerModule into your AppModule class. An example app.module.ts would look like this:
`javascript
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { ReportViewerModule } from 'ngx-ssrs-reportviewer-v2';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
ReportViewerModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
`
2. Add the report viewer to your components html template. An example app.component.html with all the report viewer attributes could look as follows:
`html
[reportserver]="reportServer"
[reporturl]="reportUrl"
[showparameters]="showParameters"
[parameters]="parameters"
[language]="language"
[width] ="width"
[height]="height"
[toolbar]="toolbar" >
`
NOTE: Many of these attributes are optional. I will cover which attributes are required below and what each one does.
4. Now inside your component the report viewer attributes specified in the ssrs-reportviewer component can be initialized. Initialization of all the attributes inside app.component.ts would look like this:
`typescript
import { Component } from '@angular/core';
@Component({
selector: 'my-app',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
reportServer: string = 'http://myreportserver/reportserver';
reportUrl: string = 'MyReports/SampleReport';
showParameters: string = "true";
parameters: any = {
"SampleStringParameter": null,
"SampleBooleanParameter" : false,
"SampleDateTimeParameter" : "11/1/2020",
"SampleIntParameter" : 1,
"SampleFloatParameter" : "123.1234",
"SampleMultipleStringParameter": ["Parameter1", "Parameter2"]
};
language: string = "en-us";
width: number = 100;
height: number = 100;
toolbar: string = "true";
}
``