Dynamically Change Tablix Column Names

  • I am wondering if there is a way to dynamically change the tablix header names based on a parameter. This parameter will be chosen before the report is ran if it is Auto the column names will be different than if the user chose Workers' Compensation. I was thinking maybe there was a way to populate a dataset in C# and then change the names and bind that dataset to the tablix. But I have no idea if this can be done this way. Thank for the help.

  • Definitely it can be done. Here's something from MSDN that might help you get started:

    MSDN: Adding a Matrix

  • I will take a look at the link. Thank you

  • So if the Parameter selection is Auto you want column headers to be something like

    COL1, COL2, COL3

    If the parameter selection is Workers Comp you want the column headers to be something like

    ColA, ColB, ColC.

    You should be able to do an expression for each column header, something like

    =IIF(Parameters!ParameterName.Value = "Auto", "COL1",IIF(Parameters!ParameterName.Value = "Workers Comp","ColA","Invalid Parameter"))

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply