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

Keeping Sub-Report Together with Parent Data

edited March 2004 in Subreports
Using Delphi 7, RB 7.03, and TextraDevices

I have a fairly simple report that is driving me crazy. The layout of the
detail band includes three TppDBMemo components to the right of four
standard TppDBText components. Each of the memos has Stretch = True and can
grow differing amounts depending upon the data. Below this single line of
data I have a sub-report in a Master-Detail relationship with the detail
record. This sub-report also contains a TppDBMemo component that can grow.
Example:
[Text1 ] [Text2 ] [Text3 ] [Text4 ] [Memo1 ]
[Memo2 ] [Memo3 ]
[Sub-Report with
]

The result I would like is that if the Sub-Report is going to span to the
next page that the detail record is also moved to the next page so that the
entire "chunk" of information is printed together. What I have been getting
is:
[Text1 ] [Text2 ] [Text3 ] [Text4 ] [Memo1 ]
[Memo2 ] [Memo3 ]
--- Page Break ---
[Sub-Report with
]

I have tried a variety of combinations of KeepTogether, Regions, etc and the
closest I have come to success is when I have a single region with
KeepTogether = True and all the components are in the single region. I set
the ShiftRelativeTo of the sub-report to Memo3 but this doesn't always work
if Memo3 is a single line and Memo1 or Memo2 are two or more lines as they
will then overprint the sub-report. I have tried putting the Memos into
their own Region and setting the ShiftRelativeTo of the sub-report equal to
the new region but then the KeepTogether effect I need goes away. It seems
one cannot embed one region inside of another.

Is there any way to do what I need. BTW the sub-report is set as a pbChild.

Thanks for any help
Richard Anderson

Comments

  • edited March 2004


    If you want all of the elements in the detail band to KeepTogether, try
    putting a child subreport in the detail band, move all of the other
    components in the detail band to the childreport's detail band. Set
    subreport.KeepTogether to True. For the childreport remove the title/footer
    and leave the datapipelien unsassigned.

    (Sorry for the delayed response - I somehow missed this message)

    --
    Nard Moseley
    Digital Metaphors
    http://www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.