This is a migrated thread and some comments may be shown as answers.

How do I change column group header value based on parameter

2 Answers 163 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Raymond
Top achievements
Rank 1
Raymond asked on 15 Dec 2014, 06:33 AM
I have a report in the designer I have the column name as "COLUMN ABC". When generating the report I am passing an int parameter, if the parameter = 1, I want the column name to be "COLUMN 123". How do I do this? I can set the report title based on the parameter in the code behind but I cannot seem to change the column name. Looks like an easy task but cannot see a way to do it. 

P/S: I've tried setting (Telerik.Reporting.TextBox)table1.ColumnGroups[4].ReportItem.Value but that does not change it when the report is generated.

2 Answers, 1 is accepted

Sort by
0
Raymond
Top achievements
Rank 1
answered on 15 Dec 2014, 10:51 PM
Anyone? Thanks...
0
Hinata
Top achievements
Rank 1
answered on 16 Dec 2014, 04:16 PM
Hi Raymond,

This can be done with an expression: http://www.telerik.com/help/reporting/report-expressions.html.
Basically, you need to combine the static text "Column" with the dynamic part which is based on your parameter.
The following expression is not tested, but I hope you will get the general idea:

= "Column " + IIf(Parameters.MyParameter.Value = 1, "123", "ABC")
Tags
General Discussions
Asked by
Raymond
Top achievements
Rank 1
Answers by
Raymond
Top achievements
Rank 1
Hinata
Top achievements
Rank 1
Share this question
or