supreport KeepTogether not working
I have a report which I have now modified per Nico's advice yesterday.
In it I have a detail band in which I have placed a subreport: srTitle.
The title section of this subreport contains a single TppDBWPTRichText
component. The detail section contains a subreport: srDetails.
The title section of srDetails contains a TppRegion which gets
populated dynamically with DBText components. The details section
contains a TppRegion component which is dynamically populated with
DBText components.
Both subreports have the KeepTogether property set true. However, I see
the report breaking these details across page boundaries, which is what
I am trying to fix. The suggestion was that I needed to use subreports
because I could not nest regions.
If I have misunderstood the process, please clarify.
I also have a problem with the TppDBWPTRichText in the title section of
the outer subreport. It is supposed to be displayed only when it
contains text, and that logic is working fine. However, when it is
displayed, I see no text content. This worked before I placed the
compoonent into a subreport.
Thanks,
Bill Meyer
In it I have a detail band in which I have placed a subreport: srTitle.
The title section of this subreport contains a single TppDBWPTRichText
component. The detail section contains a subreport: srDetails.
The title section of srDetails contains a TppRegion which gets
populated dynamically with DBText components. The details section
contains a TppRegion component which is dynamically populated with
DBText components.
Both subreports have the KeepTogether property set true. However, I see
the report breaking these details across page boundaries, which is what
I am trying to fix. The suggestion was that I needed to use subreports
because I could not nest regions.
If I have misunderstood the process, please clarify.
I also have a problem with the TppDBWPTRichText in the title section of
the outer subreport. It is supposed to be displayed only when it
contains text, and that logic is working fine. However, when it is
displayed, I see no text content. This worked before I placed the
compoonent into a subreport.
Thanks,
Bill Meyer
This discussion has been closed.
Comments
Sorry, it is difficult to present clearly in words. I have a report
with a detail band, in which I have placed the subreport srTitle. In
the detail band of srTitle, I have placed a second subreport srDetails.
srTitle has the RTF component in its title band.
srDetails has a ppRegion in its title band, to contian headers for the
detail data.
In this particular report, I have a header row followed by three data
rows, then that pattern repeats. Above the header row, there *may* be
an RTF Comment. What I need to achieve is to prevent one of any of
these 4-5 line subreports from being split across pages.
On both srTitle and srDetails, I have set KeepTogether true.
I understand the basic mechanics of the issue, but in this case, the
subreport is small, and we need to push it to the next page, rather
than let it break.
I understand. Will have to dig some more.
Replicating this in a sample may be challenging. Should there be any
problem with my using the ppRegions inside the subreports? Will that
interfere with the KeepTogether?
Thanks,
Bill Meyer
Is there a tutorial which would make a good starting point for me to
try to replicate this behavior? Or perhaps it might help me see why it
goes wrong in my project.
Thanks,
Bill Meyer
I'm a bit unclear about the design of your report. Initially you
mention a single subreport in the detail band of the main report. In
your third paragraph, you mention "both subreports". Are you referring
to the regions in this case?
If the subreport itself becomes larger than a page, it is going to have
to eventually break to a new page. If the subreport is smaller than a
page and runs out of space, it will break to a new page and continue
generating. In my simple tests, this is working correctly. If you
think you have found a case where this fails, please create a simple
example and send it to support@digital-metaphors.com in .zip format and
I'll take a look at it for you.
About the RichText component, my guess is that it is being populated in
code using a certain event handler. Note that since you moved the
control, you will also likely need to move the code to a different event
handler to property populate the control. Try tracing the event code
and see what is happening during report generation.
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
I would suggest creating a new project from scratch with a report and
button on a form. From there you can add test data using the DBDEMOS
database included with Delphi and try to mimic the behavior of your
report in a simpler setting.
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com