crystal reports how to display an image dynamically in code from asp.net

Hello Experts!
My problem is I am trying to create a re-usable report that can be used for many customers.  I customize each report with an image logo for that customer.  The reports are run from an asp.net web page.  I am using Crystal version 9, and I have read posts that not until version 11 can you dynamically display an image to the report, in version 9 only the link shows which is unacceptable.  So, is there a way in asp.net to set the location of this image to a path or URL, and how would I do this?
tegronakronAsked:
Who is Participating?
 
frodomanCommented:
>>> Then it displays ok, I do not have Microsoft Photo Editor on my machine currently.  Do you think that would make a difference?  

Sorry, I just re-read what you wrote.  ***YES*** this will make a difference.  From the link that EwaldL posted, you do need an OLE object server that can translate image types.  Doesn't have to be MS Photo Editor, it could be Photoshop or other image editing software as well.

frodoman
0
 
frodomanCommented:
As far as I know in version 9 your only option for a dynamic image would be to put the image itself inside your database as a BLOB (instead of just putting a path to the image).  This does work just fine, but the downside is that it's a lot of additional storage space needed in your db to hold the images.

frodoman
0
 
tegronakronAuthor Commented:
I thought there was a way in the vb code to assign the image to a path?
I tried to do it this way, but was unable to figure it out.

http://www.experts-exchange.com/Databases/Crystal_Reports/Q_20915695.html?query=crystal+reports+image+path&clearTAFilter=true
0
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

 
frodomanCommented:
I may have misread your question.  So you want a single image per report?  What you'll want to do then is always have your image in the same place (c:\logo.bmp for example).  To put the image in Crystal:

Insert -> OLE Object -> Create From File.  Now browse to the image (c:logo.bmp or wherever) and make sure you've checked the "link" box right below the file path.  Now you can change your image (copy a different image to c:\logo.bmp) and next time the report is opened the new image will be used.  Note that it will only update when you RE-OPEN the report - simply refreshing won't do it.
0
 
tegronakronAuthor Commented:
I tried exactly what you said there.  It looks like it creates an icon instead of the actual image in Crystal Design view and also when I run the report?  Any reason that would be?  I am exporting to a pdf file in case that makes a difference.
0
 
frodomanCommented:
Is your image a .bmp?  I don't think this works properly with other formats because Crystal internally converts other images to bitmaps.
0
 
tegronakronAuthor Commented:
well I tried it with a converted bitmap, I will try it with an original bitmap
0
 
tegronakronAuthor Commented:
I created a bitmap in paint and then inserted it to my crystal report as an ole object with a link.  Still shows up with an icon and the test.bmp text below it.
0
 
frodomanCommented:
When you insert an OLE-Object there is a checkbox for "display as icon" - make sure this is NOT checked when you insert the object.  Sounds like it may have been - if you double-click on the icon does the bmp open in MS Paint (or whatever default editor you have set)?

0
 
frodomanCommented:
Also make sure you save the report and close it completely.  Now when you open it again, you should see a progress bar with a message "Active-X links updating" (or something similar - don't remember the exact text).
0
 
tegronakronAuthor Commented:
I saved the report, and closed it, opened it again, and didn't get the "Active X Links updating" message and it still is an icon.
0
 
frodomanCommented:
I assume you also tried adding a new one and insure the display as icon wasn't checked?

I've tried to replicate the behavior you describe and the only way I can do it is with an invalid image format (e.g.: gif).  Maybe you've got a .bmp format that Crystal doesn't support?  Perhaps try it with a .jpg image instead and see if you have better results?
0
 
EwaldLCommented:
If the image shows as icon, then you need to configure the relevant ole server. This article explains how (ie install Microsoft Photo Editor). The article is about a slightly different problem, but the same resolution steps apply to you http://support.businessobjects.com/library/kbase/articles/c2006977.asp

Another option to change images on a report in .net would be to
- either upgrade to Crystal Reports XI Developer (not sure if that has been mentioned above?)
- or to pass a dataset to the report which contains the image(s) you want to see
0
 
tegronakronAuthor Commented:
Well as the link you posted suggest, I tried to double-click on the icon in the report and it brings up a prompt that says "Do you want to open this file?"  Then if I click ok, it opens Microsoft Office Picture Manger.  Then it displays ok, I do not have Microsoft Photo Editor on my machine currently.  Do you think that would make a difference?  
With regard to your post frodoman, I did at a new one, and made sure the display as icon wasn't checked.  I also tried it with a .jpg that i created in MS Paint.  I am still getting icons.  Is there perhaps a service pack for Crystal to fix this?
I think all I have is the original installed.

0
 
frodomanCommented:
I'm not aware of a patch that specifically deals with this but certainly it won't hurt you to update - it may have been solved long ago and I just never heard about the problem.  You can get the latest updates here: http://support.businessobjects.com/downloads/updates/service_packs/crystal_reports.asp

0
 
tegronakronAuthor Commented:
I found an article about how MS Photo Editor is removed when you install Office 2003 and replaces by Microsoft Office Picture Manager.  So I removed Microsoft Office Picture Manager by running Office 2003 setup and set Microsoft Picture Manager to be Not Installed.  When I re-run the report now, it shows the picture.  This only works for bitmaps, my jpg image still gave me the icon, but that is ok.  The client may not have Office installed so therefore this might not be an issue.  Thanks for the solution!
0
 
frodomanCommented:
Glad to assist.  

You might want to look around for OLE object servers - I don't know but I suspect that there may be one you can distribute in case your clients don't have Office or possibly even a Windows component that can be installed.  Good luck!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.