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
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
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
ASKER
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
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(ByVa l 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
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(ByVa
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
ASKER
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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
I'll just use a blob field instead.
Thanks for your responses guys!
ASM
mlmcc