By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,255 Members | 2,640 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,255 IT Pros & Developers. It's quick & easy.

ExcelUseConstantColumnWidth and Crystal Reports from server not wo

P: n/a
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
Mar 30 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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
"Lyners" wrote:
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

Mar 31 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.