Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Changing content of Picture Control of datareport thru Code

52 views
Skip to first unread message

Bharat P Jain

unread,
Feb 23, 2003, 5:32:59 AM2/23/03
to
Hi all ...

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

Renato

unread,
Feb 24, 2003, 5:44:30 AM2/24/03
to
Hi

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...

Bharat P Jain

unread,
Feb 25, 2003, 8:54:53 AM2/25/03
to
Hi Renato
Can u pls tell me the changes carried out ... i tried the set command
.. but no success... the report doesnt show gif files....only thing
that has changed using SET command is that now there are no errors...
this thing is bugging me for week...

Reply asap

Thanx
Bharat Jain

"Renato" <mre...@libero.it> wrote in message news:<ui9c4B$2CHA...@TK2MSFTNGP11.phx.gbl>...

Renato

unread,
Feb 25, 2003, 5:52:21 PM2/25/03
to
Hi Bharat,

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

Bharat P Jain

unread,
Feb 26, 2003, 12:44:12 AM2/26/03
to
Hi Renato,
Following is subroutine... is there anything wrong i am doing..
because somehow i couldnt get logo on report...
Reply asap...

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>...

Renato

unread,
Feb 26, 2003, 10:47:52 AM2/26/03
to
Hi Bharat,

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...

Bharat P Jain

unread,
Mar 6, 2003, 12:39:37 PM3/6/03
to
Hi ....
Thanx Renato for solving my problem...I was doing something wrong
with set command...

Bye
Bharat P Jain


"Renato" <mre...@libero.it> wrote in message news:<eeITp0a3...@TK2MSFTNGP12.phx.gbl>...

Steve

unread,
Apr 21, 2003, 6:43:19 PM4/21/03
to
Renato,
Thank you for providing this post. By using the SET
command I was able to solve the same problem.

Steve

>.
>

pranav...@gmail.com

unread,
Aug 24, 2014, 1:27:52 PM8/24/14
to
Hi bharat,

I want to dynamic image print in data report in vb6.0 how to solve this problem
.I hope you can help me

Waiting your reply
Pranav

ralph

unread,
Aug 24, 2014, 10:26:10 PM8/24/14
to
On Sun, 24 Aug 2014 10:27:52 -0700 (PDT), pranav...@gmail.com
wrote:

>Hi bharat,
>
>I want to dynamic image print in data report in vb6.0 how to solve this problem
>.I hope you can help me
>

Sorry only bad news. You can not dymaically change images within
DataReport, except for the static images in Section 4 (and Sec 1?).
You can only do this before you print a report - within
DataReport_Initialize for example.

The DataReport included with VB6 is very limited. The DR Image control
is not a true (or make that 'a complete') OLE Control, but something
that was sort of just thrown together at the last minute, thus there
is no way to communicate with it at runtime and there are NO practical
work-around's.

Your only choice is to find another Data Reporting tool - commercial
product, perhaps roll-ur-own, integrate with Word/Office, etc., etc.

-ralph
0 new messages