3
votes

I have a report that groups months by quarters, so each quarter has three months and the display of the months under the quarter is toggled by the quarter header.

It looks just fine in the ReportViewer, but when exporting to Excel the first month in the quarter with data is duplicated and appended to the end of the quarter group.

Here is what it looks like in the ReportViewer (with Quarters 2 and 4 expanded, note May and June do not have any data and show blank columns by design): http://i.imgur.com/MykZE.png

This is how it looks when exported to Excel: http://i.imgur.com/zfLuk.png

The collapsed Quarter should only show the LAST month in the quarter.

You can see that in the Excel export July is inserted in Q1 even though it should be hidden entirely since that quarter is collapsed, December is appended to Q2, January is inserted into Q3, and April is duplicated and appended to Q4.

Exporting the any format OTHER than Excel works correctly and does not insert these columns.

A similar bug for rows was filed and marked as "by design": http://connect.microsoft.com/SQLServer/feedback/details/508823/reporting-services-2008-group-by-export-to-excel-duplicate-rows-csv-ok-pdf-ok

How do I stop the export to Excel feature from inserting these duplicate columns?

1

1 Answers

0
votes

To whom it may concern, I solved similar issue by adding "fake" group (group by ="" formula) as last level (the most deep) group before details, and set its visibility to hidden.

Then this group is not shown in preview, but is used by SSRS for its "autoadded group row with [+] in Excel" - and because it's hidden/empty it doesn't cause duplicated data.