We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Bind Local Report

Thread ID:

Created:

Updated:

Platform:

Replies:

141012 Nov 19,2018 04:54 AM UTC Nov 19,2018 05:47 AM UTC PHP 1
loading
Tags: ReportViewer
MS
Asked On November 19, 2018 04:54 AM UTC

Hello,
to embedded report view and work ok, but how I can add a local report?

Mageshyadav M [Syncfusion]
Replied On November 19, 2018 05:47 AM UTC

Hi Mohamed, 
 
Thanks for contacting Syncfusion support, 
 
We can render the RDLC report in ReportViewer using PHP and Service API samples. We can pass the reportServiceUrl, reportPath and processingMode as shown in below code example in php page. 
 
Index.php: 
<?php 
$reportviewer = new EJ\ReportViewer('territorysales_reportViewer');                  
        echo $reportviewer->reportServiceUrl("http://localhost:62610/api/ReportApi" )->processingMode("Local")->reportPath("~/App_Data/Region.rdlc")->render(); 
?> 
 
We can pass the Datasource in both Design side and controller side. We have passed the Datasource  as Object model in Controller side as shown in below code example. 
 
ReportApiController.cs 
public class ReportApiController : ApiController,IReportController  
    { 
        //Post action for processing the rdl/rdlc report  
        public object PostReportAction(Dictionary < string, object > jsonResult)  
        {            
            return ReportHelper.ProcessReport(jsonResult, this); 
        } 
         
        //Get action for getting resources from the report 
        [System.Web.Http.ActionName("GetResource")] 
        [AcceptVerbs("GET")] 
        public object GetResource(string key, string resourcetype, bool isPrint)  
        { 
            return ReportHelper.GetResource(key, resourcetype, isPrint); 
        } 
         
        //Method will be called when initialize the report options before start processing the report         
        public void OnInitReportOptions(ReportViewerOptions reportOption) 
        { 
 
        } 
 
        //Method will be called when reported is loaded 
        public void OnReportLoaded(ReportViewerOptions reportOption)  
        { 
           reportOption.ReportModel.DataSources.Clear(); 
            reportOption.ReportModel.DataSources.Add(new ReportDataSource { Name = "StoreSales", Value = StoreSales.GetData() }); 
        } 
 
Please refer the below help documentation for how to load the RDLC report in ReportViewer using PHP platform. 
 
We have prepared the sample for your reference and it can be downloaded from below location. 
 
Note: Please run the Service API before running the PHP sample. 
 
Output snap: 
 
 
Regards, 
Mageshyadav.M 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon