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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Report Never Loads

Thread ID:

Created:

Updated:

Platform:

Replies:

142953 Feb 26,2019 08:08 PM UTC Mar 8,2019 01:19 PM UTC ASP.NET MVC 13
loading
Tags: ReportViewer
Lance Harwell
Asked On February 26, 2019 08:08 PM UTC

I am trying to load a local rdl report into a report viewer in my site. I am receiving no errors but the report shows the loading icon from page load and never goes away and the report never loads. I am using version 16.4450.0.52 of the EJ controls. I'm attaching what I believe to be all of the pertinent files to allow you to see what I'm doing. Can you tell what my issue is?

Attachment: Files_316ce464.zip

Mageshyadav M [Syncfusion]
Replied On February 27, 2019 11:36 AM UTC

Hi Lance, 
 
We have validated the mentioned query at our end. We have prepared standalone sample with version (16.4.0.52) and run the shared report at our end. Its working fine. Please find the output snap as given below, 
 
Snap:  
 
 
Note: We don’t have exact data of yours hence all the values are zero in above snapshot. 
 
The sample can be downloaded from the below location, 
 
Can you please confirm us whether shared sample working at your end ?.  
 
Regards, 
Mageshyadav.M 


Lance Harwell
Replied On February 27, 2019 04:09 PM UTC

Yes, the example does load. I've now tried the same jquery approach in my view and the viewer doesn't show at all now. Is there something else I'm not seeing that is different between your example and what I have based off of the files I sent you?

Lance Harwell
Replied On February 27, 2019 04:32 PM UTC

After a further investigation, I've found that this line, <script src="https://cdn.syncfusion.com/ej2/dist/ej2.min.js"></script>, in the layouts view is causing the report viewer not to load. I have an EJ2 sidebar that utilizes the script as part of the layouts view so the line needs to be there. Thoughts?

Lance Harwell
Replied On February 27, 2019 05:40 PM UTC

I have moved the sidebar to a partial view so I have moved past the issue of the the viewer not loading. My issue now is that I can not get data into the report. I'm adding the snippet from my API controller that I thought should cause the data to be pushed to the report but it did not. Each of the datatables do have data in them. Thoughts?

public void OnReportLoaded(ReportViewerOptions reportOption)
{
reportOption.ReportModel.DataSources.Clear();

List<SummaryViewModel> summary = (List<SummaryViewModel>)HttpContext.Current.Session["ReportSummaryViewModel"];
List<HospitalModel> hospital = (List<HospitalModel>)HttpContext.Current.Session["ReportHospitalModel"];
List<KeyPerformanceMetricModel> kpm = (List<KeyPerformanceMetricModel>)HttpContext.Current.Session["ReportKeyPerformanceMetricModel"];
List<BaselinePlotModel> baselinePlots15Minute = (List<BaselinePlotModel>)HttpContext.Current.Session["ReportBaselinePlots15Minute"];
List<BaselinePlotModel> baselinePlots1Hour = (List<BaselinePlotModel>)HttpContext.Current.Session["ReportBaselinePlots1Hour"];
List<MetricDefinitionModel> definitions = (List<MetricDefinitionModel>)HttpContext.Current.Session["ReportMetricDefinitionModel"];
List<ReportDateModel> dates = (List<ReportDateModel>)HttpContext.Current.Session["ReportReportDateModel"];

using (var reader = ObjectReader.Create(hospital))
{
DataTable dt = new DataTable();
dt.Load(reader);
reportOption.ReportModel.DataSources.Add(new ReportDataSource { Name = "Hospital", Value = dt });
}
using (var reader = ObjectReader.Create(summary))
{
DataTable dt = new DataTable();
dt.Load(reader);
reportOption.ReportModel.DataSources.Add(new ReportDataSource { Name = "SummaryView", Value = dt });
}
using (var reader = ObjectReader.Create(kpm))
{
DataTable dt = new DataTable();
dt.Load(reader);
reportOption.ReportModel.DataSources.Add(new ReportDataSource { Name = "KPI", Value = dt });
}
using (var reader = ObjectReader.Create(baselinePlots15Minute))
{
DataTable dt = new DataTable();
dt.Load(reader);
reportOption.ReportModel.DataSources.Add(new ReportDataSource { Name = "BaselinePlots_15Minute", Value = dt });
}
using (var reader = ObjectReader.Create(baselinePlots1Hour))
{
DataTable dt = new DataTable();
dt.Load(reader);
reportOption.ReportModel.DataSources.Add(new ReportDataSource { Name = "BaselinePlots_Hourly", Value = dt });
}
using (var reader = ObjectReader.Create(definitions))
{
DataTable dt = new DataTable();
dt.Load(reader);
reportOption.ReportModel.DataSources.Add(new ReportDataSource { Name = "MetricDefinition", Value = dt });
}
}

Mageshyadav M [Syncfusion]
Replied On February 28, 2019 09:52 AM UTC

Hi Lance, 
 
Please find the responses for the queries 
 
Queries 
Responses 
Yes, the example does load. I've now tried the same jquery approach in my view and the viewer doesn't show at all now. Is there something else I'm not seeing that is different between your example and what I have based off of the files I sent you 
We have validated the mentioned quires with your shared details at our end. The mentioned problem occurred due to invalid processing mode. If you want to load dataset from code behind at runtime, you need to set processing mode as local. Please find the code snippet as given below, 
 
public void OnInitReportOptions(ReportViewerOptions reportOption) 
{ 
    reportOption.ReportModel.ProcessingMode = ProcessingMode.Local; 
    reportOption.ReportModel.DataSources.Clear(); 
    reportOption.ReportModel.DataSources.Add(new ReportDataSource { Name = "Hospital", Value = HospitalModel.GetData() }); 
    reportOption.ReportModel.DataSources.Add(new ReportDataSource { Name = "SummaryView", Value = SummaryViewModel.GetData() }); 
    reportOption.ReportModel.DataSources.Add(new ReportDataSource { Name = "KPI", Value = KeyPerformanceMetricModel.GetData() }); 
    reportOption.ReportModel.DataSources.Add(new ReportDataSource { Name = "BaselinePlots_15Minute", Value = BaselinePlotModel.GetData() }); 
    reportOption.ReportModel.DataSources.Add(new ReportDataSource { Name = "BaselinePlots_Hourly", Value = BaselinePlotModel.GetData() }); 
    reportOption.ReportModel.DataSources.Add(new ReportDataSource { Name = "MetricDefinition", Value = MetricDefinitionModel.GetData() }); 
} 
 
We have created standalone sample and load shared report with dummy data. Its working fine. The sample can be downloaded from the below location, 
I have moved the sidebar to a partial view so I have moved past the issue of the the viewer not loading. My issue now is that I can not get data into the report. I'm adding the snippet from my API controller that I thought should cause the data to be pushed to the report but it did not. Each of the datatables do have data in them. Thoughts? 
public void OnReportLoaded(ReportViewerOptions reportOption) 
                             { 
                                           reportOption.ReportModel.DataSources.Clear(); 
                                            
                                                         List<SummaryViewModel> summary = (List<SummaryViewModel>)HttpContext.Current.Session["ReportSummaryViewModel"]; 
                                                          List<HospitalModel> hospital = (List<HospitalModel>)HttpContext.Current.Session["ReportHospitalModel"]; 
                                                          List<KeyPerformanceMetricModel> kpm = (List<KeyPerformanceMetricModel>)HttpContext.Current.Session["ReportKeyPerformanceMetricModel"]; 
                                                          List<BaselinePlotModel> baselinePlots15Minute = (List<BaselinePlotModel>)HttpContext.Current.Session["ReportBaselinePlots15Minute"]; 
                                                          List<BaselinePlotModel> baselinePlots1Hour = (List<BaselinePlotModel>)HttpContext.Current.Session["ReportBaselinePlots1Hour"]; 
                                                          List<MetricDefinitionModel> definitions = (List<MetricDefinitionModel>)HttpContext.Current.Session["ReportMetricDefinitionModel"]; 
                                                          List<ReportDateModel> dates = (List<ReportDateModel>)HttpContext.Current.Session["ReportReportDateModel"]; 
 
                                                          using (var reader = ObjectReader.Create(hospital)) 
                                                          { 
                                                                        DataTable dt = new DataTable(); 
                                                                        dt.Load(reader); 
                                                                        reportOption.ReportModel.DataSources.Add(new ReportDataSource { Name = "Hospital", Value = dt }); 
                                                          } 
                                                          using (var reader = ObjectReader.Create(summary)) 
                                                          { 
                                                                        DataTable dt = new DataTable(); 
                                                                        dt.Load(reader); 
                                                                        reportOption.ReportModel.DataSources.Add(new ReportDataSource { Name = "SummaryView", Value = dt }); 
                                                          } 
                                                          using (var reader = ObjectReader.Create(kpm)) 
                                                          { 
                                                                        DataTable dt = new DataTable(); 
                                                                        dt.Load(reader); 
                                                                        reportOption.ReportModel.DataSources.Add(new ReportDataSource { Name = "KPI", Value = dt }); 
                                                          } 
                                                          using (var reader = ObjectReader.Create(baselinePlots15Minute)) 
                                                          { 
                                                                        DataTable dt = new DataTable(); 
                                                                        dt.Load(reader); 
                                                                        reportOption.ReportModel.DataSources.Add(new ReportDataSource { Name = "BaselinePlots_15Minute", Value = dt }); 
                                                          } 
                                                          using (var reader = ObjectReader.Create(baselinePlots1Hour)) 
                                                          { 
                                                                        DataTable dt = new DataTable(); 
                                                                        dt.Load(reader); 
                                                                        reportOption.ReportModel.DataSources.Add(new ReportDataSource { Name = "BaselinePlots_Hourly", Value = dt }); 
                                                          } 
                                                          using (var reader = ObjectReader.Create(definitions)) 
                                                          { 
                                                                        DataTable dt = new DataTable(); 
                                                                        dt.Load(reader); 
                                                                        reportOption.ReportModel.DataSources.Add(new ReportDataSource { Name = "MetricDefinition", Value = dt }); 
                                                          } 
                                           } 
After a further investigation, I've found that this line, <script src="https://cdn.syncfusion.com/ej2/dist/ej2.min.js"></script>, in the layouts view is causing the report viewer not to load. I have an EJ2 sidebar that utilizes the script as part of the layouts view so the line needs to be there. Thoughts? 
We have validated the mentioned query with your shared details at our end. Please find the documentation for adding EJ2 control in your application. 
 
 
Regards, 
Mageshyadav.M 


Lance Harwell
Replied On February 28, 2019 11:31 PM UTC

Thank you for the response. This got me going. My new problems are 1) Charts are not not loading (and aren't even visible) in the rendered report and 2) trying to export the report to any format gives an error. I'm adding a zip file that includes the view, controller and rdl that are being used. I've also included 2 images. The first shows page 2 of the rendered report which should have 2 charts but instead shows an empty whites space where the first chart should be and a gray space where the second chart should be. The second image shows the error I get when trying to export the report (to Word in this example). Help please

Attachment: Files_fd089cee.zip

Mageshyadav M [Syncfusion]
Replied On March 1, 2019 10:48 AM UTC

Hi Lance, 
 
Please find the responses for your queries, 
 
Queries 
Responses 
1)Charts are not not loading (and aren't even visible) in the rendered report. 
We have validated the mentioned chart issue at our end. The mentioned issue occurred due to jQuery version mismatch. Please remove the below code in your _Layout.cshtml file. 
 
    @Scripts.Render("~/bundles/jquery") //-> Remove this line  
    @Scripts.Render("~/bundles/bootstrap") 
    @RenderSection("scripts", required: false) 
 
Now chart report item rendered properly. The modified sample can be downloaded from the below location, 
 
 
2) trying to export the report to any format gives an error. I'm adding a zip file that includes the view, controller and rdl that are being used. I've also included 2 images. The first shows page 2 of the rendered report which should have 2 charts but instead shows an empty whites space where the first chart should be and a gray space where the second chart should be. The second image shows the error I get when trying to export the report (to Word in this example). 
We have validated the shared file at our end. In shared file, image has been missed. Can you please share the image file to us ?. It will be helpful for us to determine the issue cause or provide solution at earliest. 
 
Regards, 
Mageshyadav.M 


Lance Harwell
Replied On March 1, 2019 12:42 PM UTC


Mageshyadav M [Syncfusion]
Replied On March 4, 2019 06:16 AM UTC

Hi Lance, 
 
We have validated the mentioned word export issue at our end. The word export is working fine at our end with dummy data’s. Please find the word export file as given below, 
 
 
Can you confirm us whether the issue replicated in our shared sample on pervious updated. If still you are facing issue. We would like to setup a web meeting to look on your side and provide solution. Please let us know your availability. We will make every effort to have this scheduled on a date and time of your convenience. 
 
Regards, 
Mageshyadav.M 


Lance Harwell
Replied On March 5, 2019 02:02 AM UTC

Export works like a charm in your example. My project still does not allow export to any format (Word was only my example) so it looks as though we will need to have a call. I'm available any day this week at 9 AM CST.

Also, can I default the reportviewer to open in print layout?

Mageshyadav M [Syncfusion]
Replied On March 5, 2019 11:57 AM UTC

Hi Lance, 
 
We have created an incident under your account to share meeting link and follow up meeting updates hence please log on to our support website to check for incident related to this forum.    
 
 
Regarding ReportViewer to open in print layout by default, you need to use the PrintMode property and set the value as true, 
 
@(Html.EJ().ReportViewer("reportviewer")  
               .ProcessingMode(Syncfusion.JavaScript.ReportViewerEnums.ProcessingMode.Remote)  
               .PrintMode(true)  
 
 
 
Regards, 
Mageshyadav.M 


Lance Harwell
Replied On March 7, 2019 09:46 PM UTC

Everything is exporting fine now. My next issue is that I can't rename the exported file. I'm doing the following, as suggested in other posts, but it still reverts to the report name. 

$("#viewer").ejReportViewer({
reportServiceUrl: "/api/ReportApi",
reportPath: '@ViewBag.ReportPath',
exportSettings: { exportOptions: ej.ReportViewer.ExportOptions.All & ~ej.ReportViewer.ExportOptions.Html & ~ej.ReportViewer.ExportOptions.CSV },
printMode: true,
reportExport: 'onReportExport'
});

function onReportExport(args) {
var exportName = $(args.exportAction).find('#' + this._id + '_exportfileName');
exportName.val('DemoReport_01');
}

Mageshyadav M [Syncfusion]
Replied On March 8, 2019 01:19 PM UTC

Hi Lance, 
 
We have provided the option to set the export file name in reportExport event arguments in our latest source and it will be included in our upcoming 2019 Volume 1 beta release which has been estimated to be available in next week of March 2019. We will share you snippets to achieve your requirement once beta release rolled out. 
 
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

;