3.1.1 โ€ข Published 4 years ago

ngx-ssrs-reportviewer v3.1.1

Weekly downloads
566
License
MIT
Repository
github
Last release
4 years ago

โ„น๏ธ๏ธ Description

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.

๐Ÿ”ง Installation

Install ngx-ssrs-reportviewer using npm:

``` npm install ngx-ssrs-reportviewer --save ```

or

```ng add ngx-ssrs-reportviewer```

๐Ÿ‘จ๐Ÿปโ€๐Ÿซ Usage

  1. Add ReportViewerModule and CUSTOM_ELEMENTS_SCHEMA into your AppModule class. An example app.module.ts would look like this:
    
import { BrowserModule } from '@angular/platform-browser';
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { AppComponent } from './app.component';
import { ReportViewerModule } from 'ngx-ssrs-reportviewer';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    ReportViewerModule
  ],
  providers: [],
  bootstrap: [AppComponent],,
  schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
export class AppModule { }
  1. Add the report viewer to your components html template. An example app.component.html with all the report viewer attributes could look as follows:
    <div class="container">
        <ssrs-reportviewer
            [reportserver]="reportServer"
            [reporturl]="reportUrl"
            [showparameters]="showParameters" 
            [parameters]="parameters" 
            [language]="language" 
            [width] ="width" 
            [height]="height" 
            [toolbar]="toolbar" >
        </ssrs-reportviewer>
    </div>

NOTE: Many of these attributes are optional. I will cover which attributes are required below and what each one does.

  1. 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:
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";
}

๐Ÿ“ Attributes

NameDescriptionOptionsRequired
reportserverThe rswebserviceurl of your report server. The default of most configurations looks like http://myreportserver/reportserverN/AYes
reporturlThe pathinfo of your report. This is the relative name of the report in your report server.N/AYes
showparametersControls the display of parameters.true, false, collapsedNo
toolbarControls the display of the report viewer toolbar.true, falseNo
parametersThe report parameters you are passing to the report.N/ANo
languageThe lanuage of culture-sensitive report parameters such as dates, times or currency.Lanuage CodesNo
widthThe width of the viewer relative to its container. Default is 100.1-100No
heightThe height of the viewer relative to its container. Default is 100.1-100No

๐Ÿ”ข Examples

Here are some simple examples of the report viewer.

showparameters set to "true"

showparameters set to "false"

โ— 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.

๐Ÿž Bugs

If you find this package helpful throw a star my way and please report any bugs you encounter.

3.0.9

4 years ago

3.0.4

4 years ago

3.0.3

4 years ago

3.1.1

4 years ago

3.1.0

4 years ago

3.0.8

4 years ago

3.0.7

4 years ago

3.0.6

4 years ago

3.0.5

4 years ago

3.0.2

4 years ago

3.0.1

4 years ago

3.0.0

4 years ago

2.0.7

5 years ago

2.0.6

5 years ago

2.0.5

5 years ago

2.0.4

5 years ago

2.0.3

5 years ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago