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.

Report not loading using ej report viewer in javascript.

I am using the following code to display a simple report. Below is the code of my controller:

public JsonResult GenerateReport(long reportId)
{
List reportList = GenerateReport(userDetails.Language);
return Json(reportList);
}

My javascript function to generate the report is:

function GenerateReport(event) {
var reportId = event.model.itemValue;
$.ajax({
url: "/Reports/GenerateReport?qid=" + $('body').data('usid'),
type: "POST",
data: { "reportId": reportId},
success: function (data) {
$("#viewer").ejReportViewer({
processingMode: ej.ReportViewer.ProcessingMode.Local,
reportPath: "~/docs/report.rdl",
dataSources: data,
name: "list"
});
},
error: function (jqXhr, textStatus, errorThrown) {
console.log(errorThrown);
}
})
};

I have a div in my view with id viewer.
However the report is not being loaded in my view and I see no error in my console.:

The ajax is getting the data correctly.
I have created my rdl using this link:https://reportserver.syncfusion.com/en-us/report-designer.
Please help on what I am doing wrong here?

4 Replies

MM Mageshyadav M Syncfusion Team October 26, 2018 06:02 AM UTC

Hi Alis, 
 
Thanks for your interest in Syncfusion products. 
 
We have checked the mentioned problem with your shared code files and found that you are not specified the reportServiceUrl and dataSources is not specified properly. So can you add your reportserviceurl and specify datasource values properly as shown in below code example. 
 
Default.html: 
$("#container").ejReportViewer( 
                    { 
                        reportServiceUrl: "/api/ReportApi", 
                        reportPath: '~/App_Data/GroupingAggregate.rdlc', 
                        processingMode: ej.ReportViewer.ProcessingMode.Local, 
                        dataSources:[{  
                            value: data, 
                            name: "Sales"  
                        }] 
                    }); 
 
We have prepared the sample for your reference and it can be downloaded from below location. 
 
If issue still persist then can you please revert us back with modified sample with issue reproducible case which will be helpful for us to find the exact cause and provide proper solution. 
 
Regards, 
Mageshyadav.M 



AL Alis October 26, 2018 08:00 AM UTC

Hello Mageshyadav.M,

Tahnk you for your reply.  I have one question, why do we need an APIController for the report?

Can we do without the APIController, and use an mvc controller instead?

Thanks,
Alis


MM Mageshyadav M Syncfusion Team October 29, 2018 10:20 AM UTC

Hi Alis, 
 
why do we need an APIController for the report? 
 
Can we do without the APIController, and use an mvc controller instead? 
 
In MVC Controller, it will support to bind known type in action argument and did not get unknown type in dictionary jsonResult which we are using in our reportviewer controller.  
 
 
 
So we are using the ApiController in ReportService controller for processing JSON object as shown in below snap.  
 
 
 
 
Regards, 
Mageshyadav.M 



AL Alis October 29, 2018 10:22 AM UTC

Hello Mageshyadav M,

Reports generating perfectly now.
Thanks for your help 

Loader.
Up arrow icon