SSRS: Spaces in Column Headers in CSV Output

When you output an SSRS report to CSV format, the column headers in the resulting table are determined by the DataElementName of each textbox (this might sound confusing, just know that every cell in a table is actually a textbox). Editing this property lets you customize the output, but unfortunately there are some limitations.

The column headers must be CLS-compliant. Spaces unfortunately are non-compliant, so SSRS will automatically replace spaces with underscores for the DataElementName property. At the time of me posting this I'm not aware of any sort of clean workaround for this behaviour, but if something changes or if you have a method that has worked for you, please leave a comment below.

Read More