Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Conditionally displaying images in reports

Status
Not open for further replies.

spinalwiz

Programmer
Feb 25, 2003
32
IT
I had a look around but couldnt find an answer so here goes:

I have a field in my table that stores a Microsoft Word Drawing which I want to display on my report. Only a few records actually contain a drawing, the rest are just null.

How do I display the (quite large) picture when it exists, but avoid having a huge gap in my report when it doesnt?

Thanks
 
I've not tested this myself so this might not work but:

have you tried using .visible = false when there's no picture
AND
setting the canGrow and canShrink properties
 
Unfortunately I dont think that the bound OLE control has canGrow and canShrink properties. Also, changing the visible property would make the control invisible, but doesnt stop it from taking up a huge space on the report, resulting in a big empty gap when no picture is present.
 
then you'll probably have to have some code to dynamically resize your control then...

something like:
if isnull(value) then
picture.width = "1mm"
picture.height = "1mm"
else
picture.width = "200mm"
picture.height = "200mm"
endif
 
Thanks, Ill try it. Any idea how to set the size of the OLE control to the size of the picture to be displayed?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top