ReportViewer services

RDL Report Services

URL: http://js.syncfusion.com/demos/ejservices/api/RDLReport/PostReportAction

Parameter

ReportLoad

Parameter name Data type Description
reportAction JSON Input data in the JSON format to load the report
controlId String Control ID of the widget
reportPath String Report path of the report
reportServerUrl String Specify the Report Server url to accessing the report
processingMode String Specify the processing mode of the report

GetDatasourceCredential

Parameter name Data type Description
reportAction JSON Input data in the JSON format to get the Datasource credential
dataSources JSON Datasource of the report
parameters String Specify the parameter collections

ValidateDSCredential

Parameter name Data type Description
reportAction JSON Input data in the JSON format to validate the datasource credential
dataSources JSON Datasource of the report

UpdateDSCredential

Parameter name Data type Description
reportAction JSON Input data in the JSON format to update the datasource credential
dataSources JSON Datasource of the report

GetParameters

Parameter name Data type Description
reportAction JSON Input data in the JSON format to get the parameters

SetParameters

Parameter name Data type Description
reportAction JSON Input data in the JSON format to set the parameters
parameters JSON Specify the parameters details to set the parameters

UpdateParameters

Parameter name Data type Description
reportAction JSON Input data in the JSON format to update the parameters
update param JSON Specify the parameters details to update the parameters

UpdateDataSource

Parameter name Data type Description
reportAction JSON Input data in the JSON format to update the datasource

GetPageModel

Parameter name Data type Description
reportAction JSON Input data in the JSON format to get the page model
refresh Boolean Specify whether the report refresh or not
dataRefresh Boolean Specify whether the data refresh or not
pageIndex Int Specify the page index of the report
pageInit Boolean Specify whether the page initialized or not
isPrint Boolean Specify whether the page layout is print or not

GetPrintModel

Parameter name Data type Description
reportAction JSON Input data in the JSON format to get the print model

DrillDown

Parameter name Data type Description
reportAction JSON Input data in the JSON format to process drill down
pageIndex Int specify the page index of the report
toggleInfo JSON specify the toggle information to process toggle
refresh Boolean specify whether the report refresh or not
dataRefresh Boolean specify whether the data refresh or not
pageInit Boolean specify whether the page initialized or not
isPrint Boolean specify whether the page layout is print or not

ClearCache

Parameter name Data type Description
reportAction JSON Input data in the JSON format to clear the cache

DrillThrough

Parameter name Data type Description
reportAction JSON Input data in the JSON format to process the drill through
reportName String Specify the child report name to drill through navigation
parameters JSON Specify the parameters details to process drill through
authentication Key String Specify the authentication key to process drill through

Request

        <div id="container" style="position: absolute; height: 100%; width: 100%;"></div>
        <script type="text/javascript">
            $(function () {
                $("#container").ejReportViewer(
                {
                    reportServiceUrl: '/api/ReportApi',
                    processingMode: ej.ReportViewer.ProcessingMode.Remote,
                    reportPath: '~/App_Data/Sales Dashboard.rdl'
                });
            });       
        </script>

Response

Code: 200

Content-Type:”application/json:charset=utf-8”;

Response Text:

Browser will render the reportviewer control with specified RDL report.

URL: http://js.syncfusion.com/demos/ejservices/api/RDLReport/OnInitReportOptions

Parameter

Parameter name Data type Description
controlId string Control ID of the widget
reportModel property Contains the collections of Report model items.
SubReportModel property Contains the collections of Sub Report model items.

Request

    reportOption.ReportModel.ReportingServer = new ReportingServerExt();
    reportOption.ReportModel.ReportServerCredential = new System.Net.NetworkCredential("guest", "demo");

Response

Code: 200

Content-Type:”application/json:charset=utf-8”;

Response Text:

ReportOptions will be Initialized for RDL report

URL: http://js.syncfusion.com/demos/ejservices/api/RDLReport/OnReportLoaded

Parameter

Parameter name Data type Description
controlId string Control ID of the widget
reportModel property Contains the collections of Report model items.
SubReportModel property Contains the collections of Sub Report model items.

Request

        reportOptions.ReportModel.DataSources.Clear();
        var DataSources = reportOptions.ReportModel.DataSources;   
        List<ReportParameter> parameters = new List<ReportParameter>();
        parameters.Add(new ReportParameter() { Name = "InvoiceID", Labels = new List<string>() { "InvoiceID" }, Values = new List<string>() { "10250" } });
        reportOptions.ReportModel.Parameters = parameters;

Response

Code: 200

Content-Type:”application/json:charset=utf-8”;

Response Text:

ReportOptions will be updated when loading the RDL report.

RDLC Report Services

URL: http://js.syncfusion.com/demos/ejservices/api/RDLCReport/PostReportAction

Parameter

ReportLoad

Parameter name Data type Description
reportAction JSON Input data in the JSON format to load the report
controlId String Control ID of the widget
reportPath String Report path of the report
reportServerUrl String Specify the Report Server url to accessing the report
processingMode String Specify the processing mode of the report

GetDatasourceCredential

Parameter name Data type Description
reportAction JSON Input data in the JSON format to get the Datasource credential
dataSources JSON Datasource of the report
parameters String Specify the parameter collections

ValidateDSCredential

Parameter name Data type Description
reportAction JSON Input data in the JSON format to validate the datasource credential
dataSources JSON Datasource of the report

UpdateDSCredential

Parameter name Data type Description
reportAction JSON Input data in the JSON format to update the datasource credential
dataSources JSON Datasource of the report

GetParameters

Parameter name Data type Description
reportAction JSON Input data in the JSON format to get the parameters

SetParameters

Parameter name Data type Description
reportAction JSON Input data in the JSON format to set the parameters
parameters JSON Specify the parameters details to set the parameters

UpdateParameters

Parameter name Data type Description
reportAction JSON Input data in the JSON format to update the parameters
update param JSON Specify the parameters details to update the parameters

UpdateDataSource

Parameter name Data type Description
reportAction JSON Input data in the JSON format to update the datasource

GetPageModel

Parameter name Data type Description
reportAction JSON Input data in the JSON format to get the page model
refresh Boolean Specify whether the report refresh or not
dataRefresh Boolean Specify whether the data refresh or not
pageIndex Int Specify the page index of the report
pageInit Boolean Specify whether the page initialized or not
isPrint Boolean Specify whether the page layout is print or not

GetPrintModel

Parameter name Data type Description
reportAction JSON Input data in the JSON format to get the print model

DrillDown

Parameter name Data type Description
reportAction JSON Input data in the JSON format to process drill down
pageIndex Int specify the page index of the report
toggleInfo JSON specify the toggle information to process toggle
refresh Boolean specify whether the report refresh or not
dataRefresh Boolean specify whether the data refresh or not
pageInit Boolean specify whether the page initialized or not
isPrint Boolean specify whether the page layout is print or not

ClearCache

Parameter name Data type Description
reportAction JSON Input data in the JSON format to clear the cache

DrillThrough

Parameter name Data type Description
reportAction JSON Input data in the JSON format to process the drill through
reportName String Specify the child report name to drill through navigation
parameters JSON Specify the parameters details to process drill through
authentication Key String Specify the authentication key to process drill through

Request

<div>
        <!-- Creating a div tag which will act as a container for ejReportViewer widget.-->
        <div  style="height: 650px;width: 950px;min-height:404px;" id="viewer"></div>
        <!-- Setting property and initializing ejReportViewer widget.-->
        <script type="text/javascript">
            $(function () {
                $("#viewer").ejReportViewer({
                    reportServiceUrl: "/api/ReportApi",
                    processingMode: ej.ReportViewer.ProcessingMode.Local,
                    reportPath: 'Product List.rdlc',
                    dataSources: [{
                        value: [
                        {
                            ProductName: "Baked Chicken and Cheese", OrderId: "323B60", Price: 55, Category: "Non-Veg", Ingredients: "Grilled chicken, Corn and Olives.", ProductImage: ""
                        },
                        {
                            ProductName: "Chicken Delite", OrderId: "323B61", Price: 100, Category: "Non-Veg", Ingredients: "Cheese, Chicken chunks, Onions & Pineapple chunks.", ProductImage: ""
                        },
                        {
                            ProductName: "Chicken Tikka", OrderId: "323B62", Price: 64, Category: "Non-Veg", Ingredients: "Onions, Grilled chicken, Chicken salami & Tomatoes.", ProductImage: ""
                        }],
                        name: "list"
                    }]
                });
            });
         </script>
    </div>

Response

Code: 200

Content-Type:”application/json:charset=utf-8”;

Response Text:

Browser will render the reportviewer control with specified RDLC report.

URL: http://js.syncfusion.com/demos/ejservices/api/RDLCReport/OnInitReportOptions

Parameter

Parameter name Data type Description
controlId string Control ID of the widget
reportModel property Contains the collections of Report model items.
SubReportModel property Contains the collections of Sub Report model items.

Request

            if (reportOption.ReportModel.IsDrillthroughReport)            
                return;
            var reportName = reportOption.ReportModel.ReportPath;
            reportOption.ReportModel.ReportPath = ReportViewerHelper.GetReportPath(reportOption.ReportModel.ReportPath);
            if (reportName.Contains("Product Catalog.rdlc"))
            {
                reportOption.ReportModel.DataSources.Clear();
                reportOption.ReportModel.DataSources.Add(new ReportDataSource { Name = "ProductCatalog", Value = ProductCatalog.GetData() });
            }

Response

Code: 200

Content-Type:”application/json:charset=utf-8”;

Response Text:

ReportOptions will be Initialized for RDLC Report

URL: http://js.syncfusion.com/demos/ejservices/api/RDLCReport/OnReportLoaded

Parameter

Parameter name Data type Description
controlId string Control ID of the widget
reportModel property Contains the collections of Report model items.
SubReportModel property Contains the collections of Sub Report model items.

Request

            var reportName = reportOption.ReportModel.ReportPath;
            if (reportName.Contains("Region.rdlc"))
            {
                reportOption.ReportModel.DataSources.Clear();
                reportOption.ReportModel.DataSources.Add(new ReportDataSource { Name = "StoreSales", Value = StoreSales.GetData() });
            }

Response

Code: 200

Content-Type:”application/json:charset=utf-8”;

Response Text:

ReportOptions will be updated when loading the RDLC report.

SSRS Report Services

URL: http://js.syncfusion.com/demos/ejservices/api/SSRSReport/PostReportAction

Parameter

ReportLoad

Parameter name Data type Description
reportAction JSON Input data in the JSON format to load the report
controlId String Control ID of the widget
reportPath String Report path of the report
reportServerUrl String Specify the Report Server url to accessing the report
processingMode String Specify the processing mode of the report

GetDatasourceCredential

Parameter name Data type Description
reportAction JSON Input data in the JSON format to get the Datasource credential
dataSources JSON Datasource of the report
parameters String Specify the parameter collections

ValidateDSCredential

Parameter name Data type Description
reportAction JSON Input data in the JSON format to validate the datasource credential
dataSources JSON Datasource of the report

UpdateDSCredential

Parameter name Data type Description
reportAction JSON Input data in the JSON format to update the datasource credential
dataSources JSON Datasource of the report

GetParameters

Parameter name Data type Description
reportAction JSON Input data in the JSON format to get the parameters

SetParameters

Parameter name Data type Description
reportAction JSON Input data in the JSON format to set the parameters
parameters JSON Specify the parameters details to set the parameters

UpdateParameters

Parameter name Data type Description
reportAction JSON Input data in the JSON format to update the parameters
update param JSON Specify the parameters details to update the parameters

UpdateDataSource

Parameter name Data type Description
reportAction JSON Input data in the JSON format to update the datasource

GetPageModel

Parameter name Data type Description
reportAction JSON Input data in the JSON format to get the page model
refresh Boolean Specify whether the report refresh or not
dataRefresh Boolean Specify whether the data refresh or not
pageIndex Int Specify the page index of the report
pageInit Boolean Specify whether the page initialized or not
isPrint Boolean Specify whether the page layout is print or not

GetPrintModel

Parameter name Data type Description
reportAction JSON Input data in the JSON format to get the print model

DrillDown

Parameter name Data type Description
reportAction JSON Input data in the JSON format to process drill down
pageIndex Int specify the page index of the report
toggleInfo JSON specify the toggle information to process toggle
refresh Boolean specify whether the report refresh or not
dataRefresh Boolean specify whether the data refresh or not
pageInit Boolean specify whether the page initialized or not
isPrint Boolean specify whether the page layout is print or not

ClearCache

Parameter name Data type Description
reportAction JSON Input data in the JSON format to clear the cache

DrillThrough

Parameter name Data type Description
reportAction JSON Input data in the JSON format to process the drill through
reportName String Specify the child report name to drill through navigation
parameters JSON Specify the parameters details to process drill through
authentication Key String Specify the authentication key to process drill through

Request

<div id="container" style="position: absolute; height: 100%; width: 100%;"></div>
<script type="text/javascript">
    $(function () {
        $("#container").ejReportViewer(
           {
                reportServiceUrl: "/api/SSRSReport",
                processingMode: ej.ReportViewer.ProcessingMode.Remote,
                reportPath: "/SSRSSamples2/Territory Sales new",
                reportServerUrl: "http://mvc.syncfusion.com/reportserver"
           });
    });       
</script>

Response

Code: 200

Content-Type:”application/json:charset=utf-8”;

Response Text:

Browser will render the reportviewer control with specified SSRS report.

URL: http://js.syncfusion.com/demos/ejservices/api/SSRSReport/OnInitReportOptions

Parameter

Parameter name Data type Description
controlId string Control ID of the widget
reportModel property Contains the collections of Report model items.
SubReportModel property Contains the collections of Sub Report model items.

Request

                string reportserverUrl = WebConfigurationManager.AppSettings["ReportServerUrl"];
                reportOption.ReportModel.ReportServerUrl = reportserverUrl;           
                reportOption.ReportModel.ReportServerCredential = new System.Net.NetworkCredential("ssrs", "RDLReport1");
                reportOption.ReportModel.DataSourceCredentials.Add(new DataSourceCredentials("NorthWindIO", "ssrs1", "RDLReport1"));

Response

Code: 200

Content-Type:”application/json:charset=utf-8”;

Response Text:

ReportOptions will be Initialized for SSRS report

URL: http://js.syncfusion.com/demos/ejservices/api/SSRSReport/OnReportLoaded

Parameter

Parameter name Data type Description
controlId string Control ID of the widget
reportModel property Contains the collections of Report model items.
SubReportModel property Contains the collections of Sub Report model items.

Request

        reportOptions.ReportModel.DataSources.Clear();
        var DataSources = reportOptions.ReportModel.DataSources;  
        List<ReportParameter> parameters = new List<ReportParameter>();
        parameters.Add(new ReportParameter() { Name = "InvoiceID", Labels = new List<string>() { "InvoiceID" }, Values = new List<string>() { "10250" } });
        reportOptions.ReportModel.Parameters = parameters;

Response

Code: 200

Content-Type:”application/json:charset=utf-8”;

Response Text:

ReportOptions will be updated when loading the SSRS report.

ReportViewerHelper

ReportViewerHelper class used to process the ReportViewer control in server side.

Methods:

ProcessReport(Dictionary<string, object> jsonResult, IReportController reportController)

Process the Report in Reportviewer Control with specified report details

Code snippet:

return.ProcessReport(jsonResult, this);

GetReport(string key, string type)

Getting the Report to be processed in Reportviewer Control

Code snippet:

return.GetReport(string key, string type);

GetResource(string key, string resourceType, bool isPrint)

Getting the Resource from Reportviewer Control and It will process the report Exporting.

Code snippet:

return.GetResource(string key, string resourceType, bool isPrint);

GetParameters()

Getting the Report Parameters of the Reportviewer Control

Code snippet:

return.GetParameters();

GetDataSources()

Getting the Report DataSource of the Reportviewer Control

Code snippet:

return.GetDataSources();

GetDataSetNames()

Getting the Report Dataset of the Reportviewer Control

Code snippet:

return.GetDataSetNames();