p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

crystal_reports thread: Dynamic Picture Field


Message #1 by "Art Abon" <art@d...> on Mon, 23 Apr 2001 04:15:32
Is there any known way to change a picture's source programmatically or 

dynamically?  How?



Thanks in advance.
Message #2 by "Balachandar Ganesan" <GBALA@b...> on Mon, 23 Apr 2001 14:32:34 +0530
there is a look around methid.

suppose you have a picture object first, then you want to put some other 

picture then the following code can be used.

you first identify the object to be deleted. then delete that first .annd 

in that place  you add the new picture.

the following code explains that. here i=3D3 is checked as it represents 

the

details section.



Dim app1 As CRAXDRT.Application

Dim rpt1 As CRAXDRT.Report

Dim sections As CRAXDRT.sections



Dim section As CRAXDRT.section

Dim object As CRAXDRT.OLEObject









Private Sub Form_Load()

Set app1 =3D New CRAXDRT.Application

Set rpt1 =3D app1.OpenReport("d:\report1.rpt")

Set sections =3D rpt1.sections

Dim i As Integer

i =3D 0

For Each section In sections

With section

         If i =3D 3 Then

           .AddPictureObject "c:\apache\htdocs\library\image3.jpg", 100, 

100

       End If

       i =3D i + 1

End With

Next section

rpt1.PrintOut





End Sub



before adding the picture using picture you delete the previous picture by 

using it 's name



regards

balachandar ganesan

















>>> art@d... 04/23/01 04:15am >>>

Is there any known way to change a picture's source programmatically or

dynamically?  How?



Thanks in advance.




  Return to Index