Sunday, January 31, 2010

SQL 2005 Reporting services: Columns merging when exporting to Excel.

Came across this problem when I created a report which my users wanted to export to Excel.

The problem was that when the report was exported, Excel merged some of the columns. This caused problems for my users when they wanted to work with the data in excel (pivoting the data, etc.)

The problem was caused by the positioning of the labels in my report header. If the labels did not start or end exactly at the same position as my tables, Excel inconveniently merged two columns to cope with it.

The solution was to (with a bit of trial and error) to line up the labels with the start and end of the table. Another solution is to make your title labels the full width of your report and centre your text. This does not always work when you are working with matrix's as you can not always be sure of the width of your report. In this case line up your label with a column in your table that will always be a fixed width.

No comments: