Tuesday, April 04, 2006 12:45 PM
Column Settings Not Working When Exporting From Crystal Reports To Excel
I received an e-mail in regards to my article Exporting to Excel in Crystal Reports .NET - Perfect Excel Exports:
I have crystal reports that are displayed in PDF or Excel format from an ASP.NET application. The reports are displaying, my only problem is in Excel, I keep getting fixed width columns when exporting the report. On my localhost it works (variable width columns, very esy to use), I move my product to the Windows 2003 server, and the export becomes fixed width (same size columns, very difficult to modify).
We are using Crystal Reports 9, VS.NET 2003, Windows 2003 Server, Windows XP (local box for developemnt).
My first thought was that this was a DLL problem, perhaps an outdated or incorrect one on the server. As it turned out, the problem was with some registry entries not being created when the Crystal Reports was installed:
What happened is in the server, the registry entries for export from crystal reports did not exist. I copied the register entries for Crystal Reports - Export from my machine into the server registry and it fixed my problem (I don’t know if I would recommend that for novices, due to the problems that can occur from changing the registry). In short the server didn’t know what to do with the constant width column statement until I gave it a reference.
I don't advocate poking around in the registry of a production server, especially if you're not an experienced regsitry person. Instead, I think an administrator uninstalling and reinstalling the Crystal Reports might have solved the problem. Try that first, before poking around in the registry.