Click here to Skip to main content
15,914,365 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have column(VC Name) in multipal rdlc reports.
My problem is that the column name changes every time say BU/VU Name.

I have defined such value in the webconfig, how I change the column name dynamically from code behind. So when the value changes in the config, the report picks up the value and I dont need to deploy the reports again.

Is there any way to do so??

Thanks in advance
Posted
Comments
Mohan Gopi 4-Sep-13 9:00am    
Is there any identification to identify column Name in Report. can you share some more details about your Report calling code.

1 solution

It can be done using report parameters.
You can define report parameter in report data panel.

1: In Visual Studio 2010, open your .rdlc file, and open 'Report Data' window (If you can not see this window, go to View menu to open it);
2: Right click the 'Parameters' node, and add a new Parameter, ie: named it 'myparameter';(or any name you want)

Now use this parameter in place of column name.
You can also, set default value for this parameter. And set this parameter from code behind.

ReportParameter[] params = new ReportParameter[1];
params[0] = new ReportParameter("ParaId", ParaId, false);
this.ReportViewer1.ServerReport.SetParameters(params);
this.ReportViewer1.ServerReport.Refresh();
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900