I have a query that returns over a hundred columns. The column names contain important underscores, >, < and Uppercase/lowercase characters. However, when creating the reports, SSRS designer (3.0) automatically added spaces and convert these special characters to spaces. It's really annoying. Is it possible to disable this SSRS feature?

How much work would it be to fix the headers using the following two methods?

  1. Use a script to update the column header back to the original column name.

  2. Transform the XML reporting rdl file.

  • Is this happening in the designer, in the output of the report (CSV, XLS, etc.), or both? Mar 15, 2012 at 12:22
  • @OliverAsmus Both
    – u23432534
    Mar 15, 2012 at 18:30
  • 1
    Hmm . . . I have not seen this feature as an option in SSRS. However, you can use regular expressions in the column headers to manipulate how the text is displayed - msdn.microsoft.com/en-us/library/ms157328.aspx Mar 15, 2012 at 18:37

1 Answer 1

  1. Find and Replace one of the desired characters, such as an Underscore, in the dataset query SQL with a non-sense string, such as "3145234jhasdf" ..... (minus the quotes).
  2. In Report Builder, create a DataSet with the resulting data.
  3. Create a Tablix with that DataSet. The headers in the Tablix will now look odd. As an example the header, "Column_One", will now look something like this: "Column3145234jhasdfOne".
  4. Save the file on your desktop or other local directory. It will be an RDL file. Close Report Builder.
  5. Open the resulting RDL file you saved in a text editor, such as Notepad++. You will see XML code.
  6. Find and Replace your non-sense string: "3145234jhasdf", with the character you want it to display your headers: "_".
  7. Save the file. Close the text editor.
  8. Open the file in Report Builder. Your headers should look like you want it.

You can replace more than one type of character by choosing a different non-sense string for each. For ease, keep the string alphanumeric with no spaces.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.