Image Control - How to Shrink if Empty?

B

BarbaraC

I have a report that contains 4 image controls. On most
occasions less that 4 controls actually have images in
them. How can I make the report shrink if the image
controls are empty since they don't have a "CanShrink"
property?
 
S

SA

Barb:

Image Controls are OLE controls. OLE controls can not be resized at run
time. The best you can do is to set their visible property to false. One
possible work around is to place your images and image controls each
separately on a sub report. Then place each sub on the report where you'd
want the image to be and size the sub to a very small value, setting its can
grow property to True. See if that reaches the result. The other thing to
possibly try is to check the .HasData property of the sub report with the
image (i.e. if the image is empty then the sub report should not return any
data, you could do this with an outer join possibly). Then in the On Print
event of the main report run code something like:

If me!MyImage1Sub.Report.HasData = False Then
me!MyImage1Sub.Visible = False
Else
me!MyImage1Sub.Visible = True
End if
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top