question

James Maddox avatar image
James Maddox asked

Hide column headers on a report for csv output

I have a report in SSRS that has two tables, the table on top has the detailed data for my client to see, the table on the bottom displays totals for the details. The reason I have two tables is due to the fact that i want the totals to be displayed at the bottom of a csv file. Here is the issue, as far as the table on top is concerned I want the column headers to be displayed but when it comes to the table on the bottom, I dont want the column headers to be displayed. How would I go about solving this? I cannot change the config file because I am just doing this for one csv file, I cannot place a blank value into the DataElementName because that is not allowed, and I cannot use an expression as a name that would set the value of the textbox name to null.
ssrscsvcolumnoutputheaders
4 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Mark avatar image Mark commented ·
I may be wrong about this, but I don't see the need for two tables. What happens when you add the row for the totals? They don't appear on the bottom of the CSV?
0 Likes 0 ·
James Maddox avatar image James Maddox commented ·
If you add the totals as a seperate row on the main table, the totals will appear as columns and not as a single row in a csv output
0 Likes 0 ·
Mark avatar image Mark commented ·
@James, I meant using SRRS to add the total rather than adding the total to the table. Are you referring to adding the total in the table? You can simply right-click on the detail field, then choose "Add Total."
0 Likes 0 ·
Mark avatar image Mark commented ·
After trying this myself, I see what you mean James.
0 Likes 0 ·
Mark avatar image
Mark answered
Maybe this would be a place to start since it sounds like you can exclude the header row without changing the config file. [ http://msdn.microsoft.com/en-us/library/ms155365.aspx][1] Of course, then you may have to add a row for the headers that you do want to keep (for the first table) or find another work-around for that. [1]: http://msdn.microsoft.com/en-us/library/ms155365.aspx
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Pavel Pawlowski avatar image
Pavel Pawlowski answered
If you can modify the query in the data set, you can add the the total row directly to the query. then it will be exported correctly and the totals will be last row in the table and exported correctly also into the CSV. SELECT Col1, Col2 FROM aTable UNION ALL AVG(Col1), SUM(Col2) FROM aTable I know, it's not optimal as it needs to read the data twice, but if the amount of data isn't too big, it could be a workaround for this problem.
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.