473,378 Members | 1,536 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

ExcelUseConstantColumnWidth and Crystal Reports from server not wo

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
1 4284
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: rAGHU | last post by:
Hi, In my ASP.NET web application project we need to design crystal reports with Crystal Reports version 8.5 enterpraise edition(Please Note:It is not the Crystal Reports that comes with...
3
by: Gheaci Maschl | last post by:
Hi all! I would like to have your opinion about my problem and my proposal how to solve it: Ingredients: - BTriev database - Crystal Reports - maybe MS Access - Liinos6 (small ERP software)
14
by: LP | last post by:
Hi, I will be taking on a new project developing a web-based "reporting system". The first requirement I got from BI group is "we just want to look at the data". Basically, there is a huge...
2
by: SivaKumar | last post by:
Hi All, I have developed a web application using ASP.NET which contains crystal reports. The reports are running fine on my development machine.When i deployed my application on the production...
7
by: p | last post by:
WE had a Crystal 8 WebApp using vs 2002 which we upgraded to VS2003. I also have Crystal 9 pro on my development machine. The web app runs fine on my dev machine but am having problems deploying....
17
by: Peter Proost | last post by:
Hi Group, I've got an interesting problem, I don't know if this is the right group but I think so because everything I've read about it so far says it's a .net problem. Here's the problem, we're...
4
by: Mike | last post by:
Hi We are developing an ASP.NET 2.0 application and using the in built Crystal report system that it comes with. We have everything running fine on our development server but when we publish...
2
by: =?Utf-8?B?UGF1bA==?= | last post by:
Hi I am running .net framwork 2.0 on a server and after installing a web ap that has crystal reports in it there is an error, cant find crystal report dlls that are in the web.config file. Just...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.