Reporting Services: Why aren’t all my report columns exporting to CSV and/or XML?

Don’t be surprised if reports exported to CSV or XML are missing several columns of data you otherwise see when viewing the report as HTML, PDF, etc.

PDF, HTML, and Excel export leverage “layout renderers” – a generally more expensive export process which attempts to mimic the “look” you created in Report Designer. CSV and XML are “data renderers”, and only care about data. The difference is reflected in what a layout renderer typically exports (basically everything) and what data renderers save (not necessarily all of your columns).

Here is a semi-complete list of the factors that can impact whether or not your columns are exported when saving to CSV:     

· Static Values – If a column in your report contains hard-coded static data that doesn’t change from row to row (like the value “hello”), a data render won’t bother exporting it.

· Expressions on Visibility– If you conditionally flip the Hidden property of a textbox or column in your report, data renderers will automatically omit this data from export, even if the expression evaluates to False (False meaning “don’t hide”). This is a by-design behavior.

The happy ending is that you can ultimately control the export behavior on a textbox-by-textbox basis with the DataElementOutput property. By default, this sucker is set to “Auto”, which allows the data renderer to think. If you don’t want it to think, but just OBEY, you can set this value to Yes or No.

To get to the right dialog, right-click any textbox, choose Properties on the context menu, then select the Data Output tab

Tons of thanks to Denis Levin for much of this information!

Post-publishing edits:

removed bullet re: many NULL values in a column causing data not to be exported - misunderstanding on my part