Conditional display of control, and shrinking of detail accordingly

  • Thread starter Thread starter Yair Sageev
  • Start date Start date
Y

Yair Sageev

Hi all,

I have a subreport which contains a required text field and an optional
image for each record. The image size is relatively large and takes up a
good deal of space. If the image is null, I would like the bound image
control to become invisible and the detail area of the form to shrink to the
bounding box of the text field.

This would eliminate large gaps in the table of images when no image is
provided for a record. Is there a straightforward way to do this?

Thanks for the help.
 
Thanks Terry

Will the detail section of the form automatically shrink -(height of image)
if the image is set invisible? I tried setting the image control's
visible=no and the detail section didn't shrink.

Terry said:
Yair,

I assume your images are somewhere in the file system.

IF Dir([string with path to image file])<>"" then
[imagecontrol].visible = true else [imagecontrol].visible
= false

My syntax is probably all wrong but the "dir" will test to
see if the image exists and set the visible property
accordingly.

Set this in the "on format" event for the image's section
(detail, group header, etc).

HTH,

Terry
-----Original Message-----
Hi all,

I have a subreport which contains a required text field and an optional
image for each record. The image size is relatively large and takes up a
good deal of space. If the image is null, I would like the bound image
control to become invisible and the detail area of the form to shrink to the
bounding box of the text field.

This would eliminate large gaps in the table of images when no image is
provided for a record. Is there a straightforward way to do this?

Thanks for the help.


.
 
Yair,

Good question.

With the section's "Can shrink" property set to yes I
believe the section will shrink if the limiting control
(your image) is set invisible. This assumes no other
controls are keeping the section height from contracting.

If this doesn't work try setting the height after making
the image control invisible.

"section(abc).height = 400" The 400 is an arbitary number
I put in, you will need to determine your height
requirement. The height units in a report are still a
mystery to me and I use a hit and miss method to get it
where I want.

HTH,

Terry
-----Original Message-----
Thanks Terry

Will the detail section of the form automatically shrink - (height of image)
if the image is set invisible? I tried setting the image control's
visible=no and the detail section didn't shrink.

Terry said:
Yair,

I assume your images are somewhere in the file system.

IF Dir([string with path to image file])<>"" then
[imagecontrol].visible = true else [imagecontrol].visible
= false

My syntax is probably all wrong but the "dir" will test to
see if the image exists and set the visible property
accordingly.

Set this in the "on format" event for the image's section
(detail, group header, etc).

HTH,

Terry
-----Original Message-----
Hi all,

I have a subreport which contains a required text field and an optional
image for each record. The image size is relatively large and takes up a
good deal of space. If the image is null, I would like the bound image
control to become invisible and the detail area of the form to shrink to the
bounding box of the text field.

This would eliminate large gaps in the table of images when no image is
provided for a record. Is there a straightforward way
to
do this?
Thanks for the help.


.


.
 
Back
Top