Starting in 2019, the Reporting control is no longer included in Essential Studio®. If you're experiencing issues with the Syncfusion� Reporting Platform, Report Viewer, Report Designer, or Report Writer, we recommend migrating to Bold Reports, our dedicated reporting platform.

Bold Reports offers a comprehensive suite of tools and features for all your reporting needs, and we will help you make a smooth transition from the discontinued control. Our support team at https://support.boldreports.com/ is here to assist you with any questions or difficulties you may encounter during the migration process.

We thank you for choosing Syncfusion� and appreciate your understanding.

Pass ReportData throgh http.Get Call

Hello there,

I want to pass ReportViewer DataSource by following way in Angular 2

this.http.get('http://localhost:56997/api/ReportApi/employees').subscribe(res =>
{
debugger;
this.serviceUrl = 'http://localhost:56997/api/ReportApi/';
this.serverUrl = 'http://localhost:56997';
this.reportPath = '/Reports/employee.rdl';
this.reportData = res;
});


is this possible??
Thanks in Advance

Chiranjiv Rathod





1 Reply

MM Mageshyadav M Syncfusion Team September 26, 2018 10:45 AM UTC

Hi Chiranjiv, 
 
We can pass the datasource value of the report in client side in JSON format by passing the datasource name and value as like as below code example, 
 
import { Component } from '@angular/core'; 
 
@Component({ 
    selector: 'ej-app', 
    templateUrl: 'src/reportviewer/reportviewer.component.html', 
       styleUrls: ['src/reportviewer/reportviewer.component.css'] 
}) 
 
export class ReportViewerComponent { 
    public serviceUrl: string; 
    public reportPath: string; 
       public reportData: any; 
 
    constructor() { 
        this.serviceUrl = 'http://js.syncfusion.com/demos/ejServices/api/ReportViewer'; 
        this.reportPath = 'AreaCharts.rdlc"'; 
              this.reportData = [{ 
      value: [ 
        { SalesPersonID: 281, FullName: 'Ito', Title: 'Sales Representative', SalesTerritory: 'South West', Y2002: 0, Y2003: 28000, Y2004: 3018725 }, 
        { SalesPersonID: 282, FullName: 'Saraiva', Title: 'Sales Representative', SalesTerritory: 'Canada', Y2002: 25000, Y2003: 14000, Y2004: 3189356 }, 
        { SalesPersonID: 283, FullName: 'Cambell', Title: 'Sales Representative', SalesTerritory: 'North West', Y2002: 12000, Y2003: 13000, Y2004: 1930885 } 
      ], 
      name: 'AdventureWorksXMLDataSet' 
    }]; 
    } 
} 
 
So you can pass datasource value from the Http.Get call method for the report in above format. Also we have to specify the “ProcessingMode” as Local when the datasource value for the report passed locally in WebAPI controller as shown in below code example. 
 
        public void OnInitReportOptions(ReportViewerOptions reportOption) 
        { 
            reportOption.ReportModel.ProcessingMode = ProcessingMode.Local; 
        } 
 
Please refer to the below UG documentation link for more detail, 
 
Regards, 
Mageshyadav.M 


Loader.
Up arrow icon