# ym-ssrs-report-viewer

> Angular component for rendering SSRS reports

Latest version **2.19.1** (published 2025-11-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install ym-ssrs-report-viewer
pnpm add ym-ssrs-report-viewer
yarn add ym-ssrs-report-viewer
bun add ym-ssrs-report-viewer
```

## Health

**Score 35/100 (D)** — status: maintenance-mode.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.19.1 |
| Published | 2025-11-13 |
| First published | 2019-06-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 35.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | yangmingitdp |

## Links

- npm: https://www.npmjs.com/package/ym-ssrs-report-viewer
- npm.io page: https://npm.io/package/ym-ssrs-report-viewer

## Dependencies (1)

- [tslib](https://npm.io/package/tslib.md) ^2.3.0

## Recent versions

- 2.19.1 (latest) — 2025-11-13
- 2.15.2 — 2024-07-10
- 2.15.1 — 2024-07-10
- 2.15.0 — 2024-03-18
- 2.13.0 — 2022-09-12
- 1.1.0 — 2019-07-04
- 1.0.3 — 2019-06-28

## README

YangMing SSRS Report Viewer (ym-ssrs-report-viewer)
===================
[![npm package](https://badge.fury.io/js/ngx-ssrs-reportviewer.svg)](https://www.npmjs.com/package/ngx-ssrs-reportviewer)
[![MIT license](http://img.shields.io/badge/license-MIT-brightgreen.svg)](http://opensource.org/licenses/MIT)

Original Author : [Tyler Como](https://github.com/tycomo/ngx-ssrs-reportviewer)

This library was created to give users the ability to display SQL Server Reporting Services (SSRS) reports within Angular applications.  The report viewer simplifies the process of sending commands to your report server through URL requests.  For example, you can pass parameter values and modify the controls that the user has access to inside the report viewer through your own Angular components.  You can read more about using URL access of the report server [here](https://docs.microsoft.com/en-us/sql/reporting-services/url-access-ssrs).

## Component Usage

1. Install ym-ssrs-report-viewer using npm:

    ``` npm install ym-ssrs-report-viewer --save ```

    or

    ```ng add ym-ssrs-report-viewer```

2. 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 { SsrsReportViewerModule } from 'ssrs-report-viewer';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    SsrsReportViewerModule
  ],
  providers: [],
  bootstrap: [AppComponent],  
})
export class AppModule { }

```

3. Add the report viewer to your components html template. An example `app.component.html` with all the report viewer attributes would look like this: 

```html
    <div class="container">
        <ym-ssrs-report-viewer
            [reportserver]="reportServer"
            [reporturl]="reportUrl"
            [showparameters]="showParameters" 
            [parameters]="parameters" 
            [reportModule]="reportModule" 
            [language]="language">
        </ym-ssrs-report-viewer>
    </div>
```
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 you can initialize the report viewers attributes. 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 = 'https://myreportserver/ReportServer/Pages/ReportViewer.aspx';
  reportUrl: string = 'MyReports/SampleReport'; // Please change your report url.
  showParameters: string = "true"; 
  parameters: any = {
   "SampleStringParameter": null,
   "SampleBooleanParameter" : false,
   "SampleDateTimeParameter" : "9/1/2017",
   "SampleIntParameter" : 1,
   "SampleFloatParameter" : "123.1234",
   "SampleMultipleStringParameter": ["Parameter1", "Parameter2"]
   };
  language: string = "en-us";    
  toolbar: string = "true";
  reportModule: string = "Sub-folder name";
}
```

## Attributes

| Name          | Description   | Options | Required |
| ------------- |-------------| -----:|-----:|
| reportserver  | The *rswebserviceurl* of your report server.  The default of most configurations looks like https://myreportserver/ReportServer/Pages/ReportViewer.aspx | N/A | Yes |
| reporturl      | The *pathinfo* of your report.  This is the relative name of the report in your report server.       |   N/A | Yes |
| showparameters | Controls the display of parameters. NOTE: must be string 'true' or 'false', not boolean.     |  true(default), false, collapsed   | No |
| toolbar | Controls the display of the report viewer toolbar. NOTE: must be string 'true' or 'false', not boolean.  |  true(default), false   | No |
| reportModule | The sub-folder name, if you not assign any value, will use reportModule in reportConfig. |  N/A   | No |
| parameters | The report parameters you are passing to the report.     |  N/A   | No |
| language | The lanuage of culture-sensitive report parameters such as dates, times or currency.     |  default : en-us, [Lanuage Codes](https://msdn.microsoft.com/en-us/library/ms533052(v=vs.85).aspx)  | No |                                                      

## Limitations
There are some limitations with the report viewer component that should be noted. 

1. Authentication.
 Depending on the authentication you use in your application you may run into problems with permissions.  SQL Server Reporting Services uses Windows Authentication to determine access to the reports.  If you are working in a .NET/.NET Core environment you can enable Windows Authentication in your app and the users credentials will be passed to the report server.  You could also configure your application to use Impersonation to pass the necessary credentials to your report.  How you handle these limitations will depend on your own environment.  Currently you cannot securely pass credentials to the report server with URL access.

2. Preventing Mixed Content
  The report viewer uses iframes so if your reportserver is HTTP and you are trying to render it in an HTTPS application you will run into issues.

---
## Service Usage

1. Please add `reportConfig` section to your angular project's environment.ts

```typescript

export const environment = {
  production: false,

  reportConfig: {
    reportServer: 'https://yourSSRSserver/ReportServer/Pages/ReportViewer.aspx', // ssrs server url
    reportFolder: 'YourFolderName', // replace to your report folder name, DO NOT contain '/'
    reportModule: 'YourModuleName' // replace to your report module name, DO NOT contain '/'
  }
};

```
2. Please add `{ provide: REPORT_CONFIG, useFactory: () => environment.reportConfig }` to `providers` in your angular project's app.module.ts

```typescript

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [    
  ],
  providers: [
    { provide: REPORT_CONFIG, useFactory: () => environment.reportConfig }
  ],
  bootstrap: [AppComponent]
})

```
3. Inject `SsrsReportViewerService` to your component

```typescript
export class AppComponent {
constructor(private ssrsService: SsrsReportViewerService) { }
}
```
4. Call service and use funtion
```typescript
this.ssrsService.GetReportUrl(reportName, showParameters, showToolbar, parameters, language)
```
*GetReportUrl* funtion will return a `SsrsReportParameter` model, and then you can use that model to <ym-ssrs-report-viewer> selector, like this:
```html
<ym-ssrs-report-viewer *ngIf="yourModelName"
  [reportserver]="yourModelName.reportServer"
  [reporturl]="yourModelName.reportUrl"
  [parameters]="yourModelName.parameters" 
  [showparameters]="yourModelName.showParameters" 
  [toolbar]="yourModelName.toolbar">
</ym-ssrs-report-viewer>
```

## Service Parameters

| Name          | Description   | Options | Required |
| ------------- |-------------| -----:|-----:|
| reportName  | Provides report name to SSRS, must be 8 digits | N/A | Yes |
| showParameters | Controls the display of parameters.      |  TRUE(default), FALSE   | No |
| showToolbar | Controls the display of the report viewer toolbar.  |  TRUE(default), FALSE   | No |
| parameters | The report parameters you are passing to the report.     |  N/A   | No |
| language | The lanuage of culture-sensitive report parameters such as dates, times or currency.     |  default : en-us, [Lanuage Codes](https://msdn.microsoft.com/en-us/library/ms533052(v=vs.85).aspx)  | No |                                                      

---
## Simple Examples

---
_Source: https://npm.io/package/ym-ssrs-report-viewer · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
