We help IT Professionals succeed at work.

Problem while exporting crystal report to excel using ASP, images(graphs) not displaying

617 Views
Last Modified: 2008-07-29
Hi,
I was facing an issue while exporting a crystal report to excel using ASP code.

The report data exports correctly but there are a few graphs and other images that are displayed as blank in the excel. There seems to be an image object there but it is completely blank.

Can someone please help me out with this as it is very urgent. Please find the code I am trying to perform this below. Please let me know if I am missing something.

Thanks.
Set CrystalExportOptions = Session("oRpt").ExportOptions
CrystalExportOptions.DiskFileName = sFilePath
CrystalExportOptions.FormatType = 29 'This is excel format type
CrystalExportOptions.DestinationType = CInt(1) 
 
Session("oRpt").Export False
Set Session("oRpt") = Nothing

Open in new window

Comment
Watch Question

CERTIFIED EXPERT
Top Expert 2008

Commented:
Have you tried opening the workbook on another workstation? Another version of Excel? Can you post it here?

This sounds like either a buggered Excel installation or, possibly, an incorrectly formatting report specification in Crystal Reports. The code you posted above doesn't reveal much about how the reports are formatted, it's just code to use a pre-defined format to generate an Excel workbook.

Kevin

Author

Commented:
zorvek,
I have tried it on most of the systems here. But I am recieving the same problem. The report in crystal and in pdf gets generated perfectly.

That is why I thought there might be something extra to do for excel.

Author

Commented:
Kevin,

There is not much formatting I am doing in ASP for excel. I am just passing the data to the report. I am using an OLE object for the graph which will represent the data. There is no otherformatting I am doing.
CERTIFIED EXPERT
Top Expert 2008

Commented:
If the problem occurs on other Excel systems then it is most likely something about how the Crystal Reports report is defined. Since I know very little about Crystal Reports I'll have to defer to another Expert.

Kevin

Author

Commented:
When I try to directly export the report to excel from the crystal viewer, it gives me the graph correctly> It is only when I try it through ASP code that I get this issue.

CERTIFIED EXPERT
Top Expert 2008

Commented:
That's an interesting data point. Unfortunately, I am not experienced enough in ASP or Crystal Reports to provide much more help.

I found this discussion but I'm not sure it applies:

http://www.codetoad.com/asp_excel.asp

Kevin

Commented:
Hi girishnayaks,

One possibility for you to examine is that there is a permissions problem on your web server.  It's been a while since I've used Crystal with ASP (using .Net now) but I seem to recall that when exporting any charts and images are written to the Windows Temp folder during the process.  If your application doesn't have read and/or write access to the temp folder then the images may export as blank placeholders.

I can assure you it's nothing to do with your code - there are no specific code requirements to include charts in your export.

frodoman

Author

Commented:
Frodoman,
That did not seem to work either. I changed the permissions to write for Administrators and Users and also added ASPNET and granted permissions for even that. But still it is rendering as blank.

Please let me know if I am missing something or if any other permissions need to be added.

Commented:
Try running the MS FileMon utility - it will tell you all file system access attempts and you can see if any are being denied.  It's a standalone .exe file that doesn't require any installation so it's safe to run on your web server w/out interfering with anything.

frodoman

Author

Commented:
frodoman,
I ran the application and found that I was getting this message as - "NAME NOT FOUND" for a few dlls. Ex: C:\Program Files\ Seagate Software\Report Designer Component\u25*.dll    or
C:\Crystal\U352ENU.dll

Do you think this might be the issue?
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.