Dynamically loading image in Crystal Report (NOT CR XI) which comes in with VS 2003
Hi All.
I am currently using bundled in Crystal Reports that comes with Visual Studio 2003. We have a requirement by which we need to dynamically change the image (LOGO) of each reports generated. Right now I have to embed the logo in header subreport and then include them individually in each main report(s) ...
Now I have a requirement to brand each main report based on vendor. So I want to dynamically load image in the header sub report. I am not using CR XI, but I read somewhere, where it was suggested that it can be done using OLE object and then programatically updating the physical file with the image wanted at runtime ..
How to programatically access the Picture object from rpt file ? Is there any pointer on web where I can find more detailed approch on this?
Thanks in advance.
Regards,
Pawan
Hello Pawan,
You would need to use a linked OLE object to the image file and then change this physical file before each report loads. This means that your object will be inserted into the report and point to something like:
c:\test\myimage.jpg
And at runtime you will need to swap out the myimage.jpg with the image you want to appear in the report.
http://www.dummies.com/WileyCDA/DummiesArticle/id-3044.html
Is an article that describes OLE Objects and Crystal Reports.
Keith - Business Objects
i follow ur description to add OLE Object of Image, but it just display wat i create from file. How if i want to display the image according to the FilePath in my database recordset?
Also, i create database using ADO.Net(XML).is this possible to add image dynamically when ever the report load up?
Emilie
Hello keith,
Thats a good idea, but can you tell me how can i access or set the path of the resource for an Ole object in particular section of the crystal report through VB.net.
I couldn't find any property like "Path" or "FilePath" ..............
Dim
cr3 As New CrystalReport3
cr3.Section3.ReportObjects("picture2").
thanks
Emilie,
this may help you ,
once you add in a OLE object (let said cOLEobj), then u can
declare;
dim bmp1 as stdPicture
set bmp1 = load picture("c:\sample.bmp")
cOLEobj.Formatted Picture = bmp1
or
you can set OLE obj location;
cOLEobj.SetOleLocation ("C:\sample.bmp)
ben.ooi
Hi everybody,
i solve this problem using a valid schema for the report (using an access db with a blob field while making the it) and than load all the images in a datatable blob field, before showing the report.
I know is not "good" but it works! sometimes could be useful...hope also for u

U can find it here :
http://dotnethell.it/uploads/135_loadimage.zip Bye