Link to home
Start Free TrialLog in
Avatar of laveshverma
laveshvermaFlag for India

asked on

gaining Access to image control in data report

Hello Sir,
 I want to display image in data report at run time where the name of image will be given by user.I had used the string like..
avgRating.Sections("section2").Controls.Item("image1").Picture = "d:\tpf\av.bmp"
but its not working.It is hsowing the error.
Please tell me how to display the image in data report.

Regards,
Avatar of Scott McDaniel (EE MVE )
Scott McDaniel (EE MVE )
Flag of United States of America image

What is "the error" that is showing?
Try to use the control's name directly. If we have Imag1 control, then
In format event,
Image1.Picture = "d:\tpf\av.bmp"
Avatar of laveshverma

ASKER

To Mr. LSMConsulting,
Sir I had used the following statement-
avgRating.Sections("section2").Controls.Item("image1").Picture = LoadPicture("d:\tpf\av.bmp")
But it is showing the error as:
"Object doesnt support this property or method"
How this error can be removed?
To hnasr,
sir where this code  should be written?, I am accessing the data report thru vb form . If i write the code in vb form , it show the error cuase the control " image1" is a contorl of report, not of form.
So how to correct this error?
You don't use LoadPicture for this, just set the .Picture property to the full path to your image, as hnasr has shown you. You would obviously need to refer to your control correctly, as you seem to have done here:

avgRating.Sections("section2").Controls.Item("image1").Picture = "d:\tpf\av.bmp"

ASKER CERTIFIED SOLUTION
Avatar of laveshverma
laveshverma
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
To LSMConsulting,
Sir I had tried the syntax given by you also, But it is also showing the saem error as " Oject doesnt support this property or method"