We help IT Professionals succeed at work.

Crystal Report export Excel has fix column width

My page has Crystal Report exporting the file to PDF and Excel.  Both exports the files fine.  However, in the Excel report, the columns always appear to have the same width when I open it.  Some columns have long text and the column width at the time of opening the file are not wide enough to show all the content of the rows.  The users need to resize the columns to see all the content displayed.  I have set the property: FixedColumnWidth = False in the code before the report is exporting but it does not make the columns width vary by their contents.  Any other ideas how this should be done?

Thank you.
Watch Question

I don't know if you have any real control over the column widths.  My impression is that that's just the way that the Excel export works, but I could be wrong.

 However, having said that, I did find one setting that seems to help.  I don't run reports from code.  I just run them from CR.  So, I'm looking at the options available when you do the export from within CR itself.  One of the options is "Maintain relative object position".  When I check that, the text column in my test report is much wider in the exported Excel file.  It's still sometimes not wide enough to show the entire string, but it's much wider than it was.  If you have a property for that, you might try turning it on.

 I expect that you already know this, but, just in case, you can resize all of the columns in an Excel file at the same time by clicking in the upper left corner to select all columns, and then double-clicking to resize one column will resize all of them.

Ido MilletProfessor Emeritus of MIS at Penn State Erie and Owner, Millet Software
At least one of the 3rd-party Crystal report Desktop Scheduling tools listed at: http://www.kenhamady.com/bookmarks.html
provides an option to Auto_Fit columns in Excel exports.


Hi IdoMillet:

   I have followed your link but could not find which one has the Auto_Fit Columns feature.  If you know which link specifically, can you give more info about it.  Thank you.
Ido MilletProfessor Emeritus of MIS at Penn State Erie and Owner, Millet Software

Search for XLS_AutoFit  -- sorry, but forum rules don't allow me to name the software.