How to insert an Image into report when only the image's filename and path is known at runtime?

Posted on 2005-03-08
Medium Priority
Last Modified: 2010-07-27
I need to insert an image in a report (Crystal v8.5), but the image file isn't known until runtime.

The record being reported on contains a field with the filename and path.

For example, the record has a field containing a string "C:\images\Photo of Mark.jpg." That's the file I want to display on the report.

The image file is external to the database. Only the filename and path is stored in the database.

Question by:miocolano
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
LVL 13

Accepted Solution

vidru earned 2000 total points
ID: 13492385
If this is within an application, then here's an example of how to read an image from a path at runtime:

If this is within the Crystal designer,  Chelsea Technologies has a plug-in (cViewIMAGE - it's actually a COM data source that is used in a subreport) that does this.  You can download a trial version here: http://www.chelseatech.net/download.htm

I don't know of any other way.  They finally added this functionality to CR XI.  If you want to take it for a test drive, you can get it here:


Expert Comment

ID: 13493477
If report is within your application

Add any image in crystal report and change the value at runtime through follwing code in Section_Format event

Following is samle code is provided for VB6/CR 8.5

Private Sub Section14_Format(ByVal pFormattingInfo As Object)
    Set picPhoto.FormattedPicture = LoadPicture(fldPhoto.Value)
End Sub

Author Comment

ID: 13497650
Thanks to both of you.
I am awarding the points to Dave because he answered first and provided three solutions and because the example he provided included the technique described by stcindia.  
I think that although I will be calling the report from a program, I may use cViewImage instead because it looks simpler. Also, the directions for the LoadPicture() function don't  mention JPG images, only Bitmaps and one or two other formats.
I'll need time to work these out, but I suspect that at least one of these approaches should work for me.
Thanks again,
LVL 13

Expert Comment

ID: 13497868
Glad to help.


Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question