Giter Site home page Giter Site logo

celvin / ngx-ssrs-reportviewer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tycomo/ngx-ssrs-reportviewer

0.0 1.0 0.0 184 KB

Simple Angular 2+ report viewer component for SQL Server Reporting Services

TypeScript 76.66% JavaScript 10.51% CSS 3.47% HTML 9.36%

ngx-ssrs-reportviewer's Introduction

Angular 2+ SQL Server Report Viewer (ngx-ssrs-reportviewer)

npm package MIT license

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.

Usage

  1. Install ngx-ssrs-reportviewer using npm:

    npm install ngx-ssrs-reportviewer --save

  2. Add SSRSReportViewerModule into your AppModule class. An example app.module.ts would look like this:

    
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { SSRSReportViewerModule } from 'ngx-ssrs-reportviewer';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    SSRSReportViewerModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }
  1. Add the report viewer to your components html template. An example app.component.html with all the report viewer attributes would look like this:
    <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 you can initialize the report viewers attributes. 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" : "9/1/2017",
   "SampleIntParameter" : 1,
   "SampleFloatParameter" : "123.1234",
   "SampleMultipleStringParameter": ["Parameter1", "Parameter2"]
   };
  language: string = "en-us";
  width: number = 100;
  height: number = 100;
  toolbar: string = "true";
}

Attributes

Name Description Options Required
reportserver The rswebserviceurl of your report server. The default of most configurations looks like http://myreportserver/reportserver 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. true, false, collapsed No
toolbar Controls the display of the report viewer toolbar. true, 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. Lanuage Codes No
width The width of the viewer relative to its container. Default is 100. 1-100 No
height The height of the viewer relative to its container. Default is 100. 1-100 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.

Simple Examples

Here are some simple examples of the report viewer.

showparameters set to "true"

showparameters set to "false"

toolbar set to "false" with a width and height of 50

Bugs

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

ngx-ssrs-reportviewer's People

Contributors

angular-cli avatar tycomo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.