How do I change column group header value based on parameter

3 posts, 0 answers
  1. Raymond
    Raymond avatar
    3 posts
    Member since:
    Sep 2012

    Posted 15 Dec 2014 Link to this post

    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. Raymond
    Raymond avatar
    3 posts
    Member since:
    Sep 2012

    Posted 15 Dec 2014 in reply to Raymond Link to this post

    Anyone? Thanks...
  3. Hinata
    Hinata avatar
    146 posts
    Member since:
    Dec 2013

    Posted 16 Dec 2014 in reply to Raymond Link to this post

    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")
Back to Top