Adjusting Report Sections height

  • Thread starter Thread starter JonWayne
  • Start date Start date
J

JonWayne

If I want to adjust the height of a section based on the availability of
data in controls in that section, what event do I place it in? I have labels
in a section that I make visible/invisible depending on certain conditions.
When I hide the labels, I need to reduce the height of the section (group
header section), and expand it otherwise. I have tried it in the Format and
Print events and emerge with the Error, 'Cant adjust that property after
printing has began'.

Also, if I change the height, will the settings apply individually for each
group?
 
JonWayne said:
If I want to adjust the height of a section based on the availability
of data in controls in that section, what event do I place it in? I
have labels in a section that I make visible/invisible depending on
certain conditions. When I hide the labels, I need to reduce the
height of the section (group header section), and expand it
otherwise. I have tried it in the Format and Print events and emerge
with the Error, 'Cant adjust that property after printing has began'.

Also, if I change the height, will the settings apply individually
for each group?

Have you looked at the CanGrow and CanShrink properties of the section?
 
Thank you, but after doing some reading on the subject, I learnt that white
spaces below and above controls were not intended to be shrunken by the
CanShrink property. I, however, figured out a trick that worked: stick
textboxes in those white spaces and set the control's ForeColor and
BackColor properties to that of the section's BackColor. In the Format event
of the section, set the visible property of the controls according to your
specific needs, and the CanShrink/CanGrow settings will do the job. With the
color properties set as described, even hen those controls are visible, the
text wont show. Also set the border display properties, of the controls, as
you wish.
 
JonWayne said:
Thank you, but after doing some reading on the subject, I learnt that
white spaces below and above controls were not intended to be
shrunken by the CanShrink property. I, however, figured out a trick
that worked: stick textboxes in those white spaces and set the
control's ForeColor and BackColor properties to that of the section's
BackColor. In the Format event of the section, set the visible
property of the controls according to your specific needs, and the
CanShrink/CanGrow settings will do the job. With the color properties
set as described, even hen those controls are visible, the text wont
show. Also set the border display properties, of the controls, as you
wish.

It sounds like you found a good solution. Another approach might be to
make all the text boxes taller than they need be to show the text, so
that they abut one another. If this is feasible, there wouldn't be any
white space between them.
 
Back
Top