My company is developing a series of SSRS 2012 reports where we pivot rows to columns for display in the report viewer, but want the data unpivoted (default behavior) when a client exports the report to CSV. This seems to work fine except that extra NULL value rows are generated in the unpivot that is part of the export.
Here is an example:
Dataset
Col1| Col2 | Col3
a| 1 | $5.99
a| 2 | $4.25
b| 1 | $8.99
Pivoted in Report Viewer
Col1| 1 | 2
a| $5.99 | $4.25
b| $8.99 |
Export to CSV (NOTE THE EXTRA ROW AT THE END)
Col1| Col2 | Col3
a| 1 | $5.99
a| 2 | $4.25
b| 1 | $8.99
b| 2 | NULL
My question is whether this is the expected behavior or a bug in SSRS CSV rendering? Is anyone aware of a workaround?
I did notice that in the MS documentation regarding CSV rendering of matrices it says, "Renders by expanding the matrix and creating a row and column for each row and column at the lowest level of detail. Subtotal rows and columns do not have column or row headings." So maybe that answers my question but I am hoping there is a workaround.
Thanks,
Andrew