views:

472

answers:

1

I am having an issue exporting Crystal Reports into an excel file.
I tried both options of exporting the Excel data AND exporting as an excel file. When i export my Crystal Report as an excel file, i cannot sort any of the fields in my excel file. When i export the report as just the excel data, when i open in Excel, the headers are really messed up. The first three headers appear at the END of all of the columns--which doesn't make any sense to me.

Does anybody know how to change export options in Visual Studio? I am using Crystal Reports on Visual Studio and have no idea how to change any of these options.

+2  A: 

It sounds like your report has not been laid out in an optimal way for Excel export, and it's not Visual Studio or the export options that is the problem here. Depending on your version of Crystal, some tips would be :

1) Make sure all column headers are the same width and left-most position as the data they relate to.
2) Minimize gaps between column headers, and also gaps between detail rows.

Unless you're using earlier than CR8.5, it's likely you can't sort because the export has created lots of merged cells - points 1 and 2 will mitigate this substantially. Basically, if you're exporting to Excel you want your report's data to be laid out as similar to an Excel spreadsheet as possible.

CodeByMoonlight
you're absolutely right about CR8.5 merging cells in excel. Actually i figured out that if i made all the boxes in the Details section of my report the same size, they would show up in the excel sheet the way they are laid out on the report. It's so weird--but i think what excel was doing was reading 2-line column headings first and then appending the 1-line column headings last. If you make them all the same size, it reads them in order.