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. Image for the cookie policy date
close icon
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.

Not able to set ReportViewer label

I'm building an web application using AngularJS for the frontend and WebAPI (C#) for the backend.

I created an RDLC report with a boolean parameter called 'ShowPrevYear (see attached RDLC file). 

What I want to do is, hide some columns of my report depending on the value of the parameter ShowPrevYear. The user should be able to show/hide the report colums by selecting the corresponding option in the header of the report viewer.

To do this I created the following OnInitReportOptions() method in the report api controller:

        public void OnInitReportOptions(ReportViewerOptions reportOption)

        {

            //You can update report options here

            reportOption.ReportModel.ReportPath = reportPath + reportOption.ReportModel.ReportPath;

            reportOption.ReportModel.DataSources.Clear();

            reportOption.ReportModel.DataSources.Add(new ReportDataSource { Name = "DataSetErgebnis", Value = GetDataEgebnis() });


            //Set report parameter programmaticaly

            List<ReportParameter> parameters = new List<ReportParameter>();

            parameters.Add(new ReportParameter() { Name = "ShowPrevYear", Labels = new List<string>() { "Ja", "Nein" }, Values = new List<string>() { "true", "false" } });

            reportOption.ReportModel.Parameters = parameters;

        }


When I show the report in the angularjs frontend the caption/label of the report parameter is always 'ReportParameter1' instead of 'ShowPrevYear' as expected (see attached JPG). I would like to set the parameters label to some meaningful to the user and I would like to localize the labels of the parameter options. How can I do this?


Attachment: tmp_ab1dceae.zip

3 Replies

YD Yuvaraj Devarajan Syncfusion Team March 13, 2017 07:21 AM UTC

Hi Peter, 

Thanks for contacting Syncfusion support. 

The Visual Studio RDLC designer doesn’t allow to create/edit the Report parameter labels (prompt name) in UI due to some RDLC compatibility. Hence the report parameter is displayed with the default name. To avoid this, you can manually add/edit the prompt node in RDLC definition file in XML view as shown in the below screenshot, 

 

For RDL: In ReportBuilder, you can able to modify the parameter name in Report Parameter property dialog box as shown in below screenshot, 
 

Please refer the below MSDN link for more detail, 

We have modified your shared RDLC file and prepared a sample which can be downloaded from below location, 

Regards, 
Yuvaraj D. 



PH Peter Horak March 18, 2017 11:04 AM UTC

Hi Yuvaraj,

thanks for your helpful reply. It nearly solves my problem. 

Now I am going to localize the report viewer control to german language. There I have another problem with the boolean report parameter. The default labels keep being displayed in english (Yes/No) instead of german (Ja/Nein). I attached a sample screen shot and my rdlc file.

How can I localize the these parameter value labels?

Regards Peter

Attachment: Reports_e7dd9b9.zip


RK Ravi Kumar Gurunathan Syncfusion Team March 20, 2017 12:56 PM UTC

Hi Peter, 
 
We have internally progressed the value of report parameters in an English language, so that we provided the localize only to an UI of reportviewer control and it will not change the display text of boolean report parameter, if we need to change that display text then we can customize it through script. In our control, we need to configure the “renderingcomplete” event trigger and then get the Html element to modify the display text of boolean report parameter as shown in below snap. 
 
 
 
 
Note: As per Report definition standard, the display text of report parameter will not be changed based on the localize. Please refer the below MSDN link for more detail, 
 
We have prepared a sample with your RDLC file which can be downloaded from below location,  
 
Regards, 
Ravi kumar G

Loader.
Live Chat Icon For mobile
Up arrow icon