"Can Grow" property

M

Mona-ABE

I have 3 fields in a report with the "Can Grow" property set to true. In
most cases only one cell (comments) is the one that grows in size vertically.
I've used borders around the fields to create an appearance of a table cell
for each item. Yet, when only one grows, all their border lines don't grow
together. Is there a way to make all the fields grow to the same height at
once?
 
R

Rick Brandt

Mona-ABE said:
I have 3 fields in a report with the "Can Grow" property set to true.
In most cases only one cell (comments) is the one that grows in size
vertically. I've used borders around the fields to create an
appearance of a table cell for each item. Yet, when only one grows,
all their border lines don't grow together. Is there a way to make
all the fields grow to the same height at once?

It's not trivial to do. Basically you remove the visible borders from your
TextBoxes and then draw your own using the following methods. This assumes a
detail section with TextBoxes that start at the very top of the section and
extend to the botttom of the section.

Use the line tool from the Toolbax to draw two horizontal lines, one above the
row of TextBoxes and one just below. Test the report to ensure that the lower
horizontal line is properly "pushed" down the page when TextBoxes grow.

Now you use code in the detail section's OnFormat event to draw the vertical
lines using the line method of the report. The line method basically allows you
to draw lines and boxes by specifying the upper left coordinate and the lower
right coordinate. Here you take advantage of one behavior of the line method.
That is that you cannot use the line method to draw a line or box that extends
outside of the section where the method is called. In this case since we are
using the line method in the format event of the Detail section then no matter
what coordinates you use the lines created cannot extend above or below the
detail section.

Given the above all you have to do is specify 0 as the top coordinate and a very
large number for the lower coordinate and the lines thus drawn will always
extend to the bottom of the detail section as it grows and shrinks.

Using the line method requires a bit of trial and error to get the positioning
correct, but once you have one line drawn all you have to do is copy that line
of code and change the coordinates that control the horizontal position for the
next line you want.
 

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