ExcelUseConstantColumnWidth and Crystal Reports from server not wo

G

Guest

Hello all,
I have created an ASP.NET website that uses Crystal Reports that works on
the localhost (my PC), but when I copy it to the server it does not.

The problem is ExcelUseConstantColumnWidth = False.

On my PC when exporting a report, it works - columns are varible width to
fit the field, from the server it does not - I get constant width columns. I
suspect it is a DLL issue, but so far all my comparisons are coming out the
same.

Here is my code to export the report;

Select Case oExportType
Case "Excel"
ExportFileName = Server.MapPath("/") &
ConfigurationSettings.AppSettings("ExportDir") & Session.SessionID & ".xls"
Case "PDF"
ExportFileName = Server.MapPath("/") &
ConfigurationSettings.AppSettings("ExportDir") & Session.SessionID & ".pdf"
End Select
Try
oRpt.ExportOptions.ExportDestinationType =
CrystalDecisions.[Shared].ExportDestinationType.DiskFile
Select Case oExportType
Case "Excel"
Dim objExcelOptions As ExcelFormatOptions = New
CrystalDecisions.[Shared].ExcelFormatOptions
objExcelOptions.ExcelUseConstantColumnWidth = False
oRpt.ExportOptions.ExportFormatType =
CrystalDecisions.[Shared].ExportFormatType.Excel
oRpt.ExportOptions.FormatOptions = objExcelOptions
Case "PDF"
oRpt.ExportOptions.ExportFormatType =
CrystalDecisions.[Shared].ExportFormatType.PortableDocFormat
End Select
oDest.DiskFileName = ExportFileName
oRpt.ExportOptions.DestinationOptions = oDest
oRpt.Export()
'Send the file to the user that made the request
Response.Clear()
Response.Buffer = True

Can anyone shed some light on why this would work differently from the
server than my PC and how I should go about trying to fix it?

Thank you,
Lyners
 
G

Guest

I have figured out my problem. On the server, Key registry entries were
missing, once I added them, the application worked fine.

Here were my extra registry entries:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Crystal Decisions\9.0\Crystal Reports\Export]

[HKEY_LOCAL_MACHINE\SOFTWARE\Crystal Decisions\9.0\Crystal
Reports\Export\Crxf_xls]
"ColumnWidthBaseArea"=dword:000000ff
"ColumnWidthGroupNumber"=dword:00000001
"UseConstantColumnWidth"="False"
"ConstantColumnWidth"=dword:000002d0
"ShowGridLines"="No"

[HKEY_LOCAL_MACHINE\SOFTWARE\Crystal Decisions\9.0\Crystal Reports\Export\CSV]
"AreaExportOptions"=dword:00000000

[HKEY_LOCAL_MACHINE\SOFTWARE\Crystal Decisions\9.0\Crystal
Reports\Export\HTML]
"EncodeHTMLForSingleLineFieldObjects"="Yes"

[HKEY_LOCAL_MACHINE\SOFTWARE\Crystal Decisions\9.0\Crystal
Reports\Export\TextExport]
"CharPerInch"=dword:00000009
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,479
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top