I have rptImage Control on datareport ... i would like to change its
picture content thru code... is it possible ?... I tried using
loadpicture(Filename).. it gives me an error such as invalid use of
property...
Code snippet
--------
formatpic Report1.sections(2).controls(1),"logo.gif"
Report1.show
.
.
.
private sub formatpic(pic1 as rptimage,filename as string)
if typeof(pic1) as rptimage then
With pic1
.picture = loadpicture(filename)
end with
end if
End sub
Suggest me whats wrong in this code.. same funda i am using for
changing rptlabel control properties thru code
Thanx
Bharat P Jain
I made only a couple of changes and it works fine...
As the property you are setting to is an object you have
to use the command SET.
Bye Renato
Private Sub formatpic(pic1 As RptImage, filename As String)
If TypeOf pic1 Is RptImage Then
With pic1
Set .Picture = LoadPicture(filename)
End With
End If
End Sub
"Bharat P Jain" <jainb...@vsnl.net> ha scritto nel messaggio
news:30488dd6.03022...@posting.google.com...
Reply asap
Thanx
Bharat Jain
"Renato" <mre...@libero.it> wrote in message news:<ui9c4B$2CHA...@TK2MSFTNGP11.phx.gbl>...
I noted something wrong in the second line of your subroutine..
the correct syntax is: if typeof(pic1) IS rptimage then
and not: if typeof(pic1) AS rptimage then
You can use the statement AS only with DIM command.
I made this error many times... :-)
Happy to help you,
bye Renato
Private Sub FormatPic(LogImg As RptImage, fname As String)
If TypeOf LogImg Is RptImage Then
With LogImg
Set .Picture = LoadPicture(fname)
End With
End If
End Sub
Thanx
Bharat Jain
"Renato" <mre...@libero.it> wrote in message news:<udtrT9R3...@TK2MSFTNGP09.phx.gbl>...
simply a question...how do you pass the RptImage?
I use this method:
With DataReport1
FormatPic .Sections("Header").Controls("Image1"), "C:\My
Documents\Images\sunflower.jpg"
.....
.Show
End With
If you want I can send to you a little example.
Please let me know.
Bye Renato
"Bharat P Jain" <jainb...@vsnl.net> ha scritto nel messaggio
news:30488dd6.0302...@posting.google.com...
Bye
Bharat P Jain
"Renato" <mre...@libero.it> wrote in message news:<eeITp0a3...@TK2MSFTNGP12.phx.gbl>...
Steve
>.
>