<?php
$reportviewer = new EJ\ReportViewer('territorysales_reportViewer');
echo $reportviewer->reportServiceUrl("http://localhost:62610/api/ReportApi" )->processingMode("Local")->reportPath("~/App_Data/Region.rdlc")->render();
?> |
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() });
} |