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
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