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.

Having trouble getting report to preview - issue with either subreports or parameters

Hi all, I am setting up the report viewer in a UWP application and I have having trouble with a report that has several parameters and subreports.  Prior to this, I have been able to preview reports that did not have parameters or subreports.  We are just beginning to use the report viewer control, and we will have many reports with multiple parameters and multiple subreports.  All subreports should use the same datasource as the main reports.  

Here are the details:
- Using UWP controls version 15.3.0.26.

- The report has 2 string parameters that do not accept nulls.  Each parameter has a default value in the report definition.  Question: do I still need to supply a value for each parameter, and if so, do I do as per this article: "https://www.syncfusion.com/kb/7050/how-to-set-parameter-to-reportwriter"?

- The report has many subreports.  Do I need to supply a value for the DataSourceCredentials of the subreports?  If so, how do I do that?  Please provide documentation.

- The report runs fine when I browse to it directly on the SSRS Report Server via my web browser.  It displays without any errors.

- When I run the report in the UWP application, the busy spinner just runs forever in the report viewer.  No exceptions are thrown on the Web API report controller, or on the UWP code-behind file were the report viewer control is accessed.

7 Replies

VS Vinoth Srinivasan Syncfusion Team November 9, 2017 01:56 PM UTC

Hi Ryan, 
 
Thanks for your interest in Syncfusion Components. 
 
Query 
Response 
The report has 2 string parameters that do not accept nulls.  Each parameter has a default value in the report definition.  Question: do I still need to supply a value for each parameter, and if so, do I do as per this article: "https://www.syncfusion.com/kb/7050/how-to-set-parameter-to-reportwriter"? 
 
If you have specified default values for the parameter in report itself, then no need to pass the default values to the parameter from code behind. 
The report has many subreports.  Do I need to supply a value for the DataSourceCredentials of the subreports?  If so, how do I do that?  Please provide documentation. 
Yes, you have to specify the datasource credential for the subreport in “OnInitReportOptions” in your WebAPI controller. Please refer the below code snippet. 
 
public void OnInitReportOptions(ReportViewerOptions reportOption) 
        { 
            //You can update report options here 
            if (reportOption.SubReportModel != null) 
            { 
                reportOption.SubReportModel.DataSourceCredentials = new List<DataSourceCredentials>(); 
                reportOption.SubReportModel.DataSourceCredentials.Add(new DataSourceCredentials("AdventureWorks", "ssrs1", "RDLReport1")); 
            } 
 
        } 
 
We have prepared a sample based on this and it can be downloaded from the below location 
 
 
 
Regards, 
Vinoth S. 



RR Ryan Richard November 9, 2017 04:10 PM UTC

I have inserted the code to set the subreport datasource on the Web API controller, and I am still having the issue (the report comes back blank, no error or exceptions are thrown).  In my case, the "reportOption.SubreportModel" property is always null, so I instantiated it in the "OnInitReportOptions" method in the Web API report controller (see code below).  Please provide additional troubleshooting steps, or let me know if I need to provide additional technical details.

//update subreport

            if (reportOption.SubReportModel == null)

            {

                reportOption.SubReportModel = new SubReportModel();

            }

            reportOption.SubReportModel.DataSourceCredentials = new List<Syncfusion.Reports.EJ.DataSourceCredentials>();

            reportOption.SubReportModel.DataSourceCredentials.Add(new Syncfusion.Reports.EJ.DataSourceCredentials(reportDatasourceName, reportDatasourceUserName, reportDatasourcePassword));

             



VS Vinoth Srinivasan Syncfusion Team November 10, 2017 10:51 AM UTC

Hi Ryan, 

In our reporting control we will initially process the main report and then the subreport will be processed. So, initially the subreport model will come as null and once subreport model is start to evaluate the “reportOption.SubReportModel” will be initialized. So, we request you to the use previously shared code snippet in your WebAPI Controller in OnInitReportOptions method as like below. 

if (reportOption.SubReportModel != null) 
{ 
    reportOption.SubReportModel.DataSourceCredentials = new List<Syncfusion.Reports.EJ.DataSourceCredentials>(); 
    reportOption.SubReportModel.DataSourceCredentials.Add(new Syncfusion.Reports.EJ.DataSourceCredentials(reportDatasourceName, reportDatasourceUserName, reportDatasourcePassword)); 
} 


Regards, 
Vinoth S. 



RR Ryan Richard November 10, 2017 02:55 PM UTC

Vinoth, I have placed the code snippit in the "OnInitReportOptions" controller method as you suggested, and I am still unable to run the report (it comes back completely blank).

I put a breakpoint within the "If" block, and it never gets hit.  So, the "reportOption.SubReportModel" property is always null, even though the report I am trying to run has several subreports.

Please let me know what additional steps I can take to troubleshoot the report.  We will have a lot of report with subreports that we will need to preview.





VS Vinoth Srinivasan Syncfusion Team November 13, 2017 08:45 AM UTC

Hi Ryan, 

The mentioned problem occurs when subreport is not referred in main report or specified subreport path is incorrect in main report. So, could you please share your sample or reports to reproduce the problem at our end. It will be helpful for us to validate the problem at our end. 

Regards, 
Vinoth S. 



RR Ryan Richard November 15, 2017 03:10 AM UTC

Hi Vinoth, I have attached the RDL file for the report for you to look at.  By the way, I was mistaken when I said the the report has several subreports.  The report does not have any subreports.  It does have two parameters and several datasets.




VS Vinoth Srinivasan Syncfusion Team November 15, 2017 12:30 PM UTC

Hi Ryan, 

We have further analyzed your shared report and no default value has been specified for the parameters in your report, so it shows the spinning indicator. We suggest you to specify default values for the parameters in RDL file or specify the parameter values from the parameter dialog in runtime, also value can be set for the parameter in code behind. We have modified your report with default values for the parameter and it can be downloaded from the below location. 


Also, if you don’t have a subreport then there is no need to specify the credentials for the subreport in WebAPI service. Please refer the following help documentation for more details. 


Regards, 
Vinoth S. 


Loader.
Up arrow icon