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