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,
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.
|
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.
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. |
@(Html.EJ().ReportViewer("reportviewer")
.ProcessingMode(Syncfusion.JavaScript.ReportViewerEnums.ProcessingMode.Remote)
.PrintMode(true)
|