Link to home
Start Free TrialLog in
Avatar of ISS_Expert
ISS_Expert

asked on

Dynamically load pictures in report

Hi all,

I need to dynamically load pictures in my crystal report.  Using BLOB field is simple but the database will get bloated very quickly and also writing code to upload the picture from my VB application would be tedious.  Is there a better way of doing it?  Can I store only the path to the picture in the database and load it in my report?  I'm using CR 10.

Thanks in advance,
ASM
ASKER CERTIFIED SOLUTION
Avatar of peter57r
peter57r
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Mike McCracken
Mike McCracken

Pete is correct.  Until CR11 (CR XI) you can't accomplish what you want without storing the pics in the database or using VB to load them.

mlmcc
Avatar of ISS_Expert

ASKER

But to use VB to load the pics, I need to use the embedded version (VB) of Crystal Reports right?
We have managed to do this in Crystal 8 but we had to buy a third party bit of software.  It worked by taking the unc path of where the picture was stored and would dynamically load it at run time.  Works very well but had to purchase the software.
ISS_Expert

If you're using VB you don't need to use the version embedded with VB. Crystal Developer and advanced editions install with developemnt controls which can be used to access report methods and properties.

You could also use something like CViewImage found at http://www.chelseatech.co.nz/ctprod.htm#cViewIMAGE if you don't want to do the development.

Hope this helps

Gary
Hi Gary,

How do I go about inserting the picture through VB?  I am using CR viewer control and Crystal report activex designer run time library 10 in my VB program.  I can't find any property in CRAXDRT.Report which can be used to access the picture object in my report.

Thanks in advance,
ASM
If you look at this link provided above

http://support.businessobjects.com/communityCS/FilesAndUpdates/cr9_vb_rdc_loadpic.exe.asp

it demonstartes how to do this. basically you insert the image into the report and use the section_format method

Private Sub DetailSection1_Format(ByVal pFormattingInfo As Object)

  Dim picFile As String
 
    On Error GoTo Error_Handler
   
    picFile = "C:\Myimage.jpg" ' change this to the path of the image you want to display

    Set objImage.FormattedPicture = LoadPicture(picFile)
   
Exit Sub

Hope this helps

Gary
I am not using the embedded version of Crystal in VB and so I don't have the section_format method.  I have created the report using CR developer edition and all I am only firing the report from VB.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Gary,  I don't want to import the report into the project.

I'll just use a blob field instead.

Thanks for your responses guys!

ASM