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

[868 byte] By [pawan_atl] at [2008-2-12]
# 1
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

KeithThomson at 2007-9-8 > top of Msdn Tech,Visual Studio,Crystal Reports for Visual Studio...
# 2
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

k_emilie5602 at 2007-9-8 > top of Msdn Tech,Visual Studio,Crystal Reports for Visual Studio...
# 3
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

Rohit_crystal at 2007-9-8 > top of Msdn Tech,Visual Studio,Crystal Reports for Visual Studio...
# 4
Hello,

You cannot access or set the path for the OLE Object - it does not have an exposed property to do this.

Keith - Business Objects

KeithThomson at 2007-9-8 > top of Msdn Tech,Visual Studio,Crystal Reports for Visual Studio...
# 5

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

ben.ooi at 2007-9-8 > top of Msdn Tech,Visual Studio,Crystal Reports for Visual Studio...
# 6
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 Smile
U can find it here : http://dotnethell.it/uploads/135_loadimage.zip
Bye
matteoraumer at 2007-9-8 > top of Msdn Tech,Visual Studio,Crystal Reports for Visual Studio...
# 7

Hi dear,

I can not access http://dotnethell.it/uploads/135_loadimage.zip path

please help me that i can change a image dynamically crystal report.

thanks

Taherehfarrokhi at 2007-9-8 > top of Msdn Tech,Visual Studio,Crystal Reports for Visual Studio...
# 8

Hi

Who resolve the problem....

I need help too..

thanks

Paulo

Pimenta186 at 2007-9-8 > top of Msdn Tech,Visual Studio,Crystal Reports for Visual Studio...

Visual Studio

Site Classified