Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Regions: KeepTogether

edited October 2001 in General
Hello,

I have a complex report, because it contains several regions, but all
components in these regions are created at runtime (because the
components in the report are the result of the decision the user of my
application makes, I never know if I'm going to need e.g. 2 or 20
TppLabels).

I've put my KeepTogether Property to True, so that everything in a
region sticks together. But because I'm creating my components at
runtime, I have to set my top property of my components, e.g.

var
L: TppLabel;
begin
L := TppLabel.Create(self);
L.Band := TppBand(BandName);
L.Region := TppRegion(RegionName);
L.Top := lblTop;

The top is relative to the previous component (hence the variable
lblTop). But it is also relative to the top of the band and not the top
of the region. So when a region starts at the bottom of a page and I
create a label, it has a top of e.g. 180 mm (while the region has an
initial top of e.g. 160mm). But when the region moves to the next page,
then the top of the region is e.g. 0mm, but the top of the label remains
180mm, and not 20 mm (as I expected). How can I solve this problem?

FYI: Delphi 4 Professional, RBuilder Standard 5.56

Greetinx and TIA

Joost

Comments

This discussion has been closed.