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

printing ppMemos on pagebrakes

edited April 2002 in General
Hi,

i have to generate a report with about 12 streched ppMemos on it.

The first contains 4 lines in a textheader (font is bold) and the second
contains the information.
The third contains a 4 lines in a textheader and the next Memo contains text
so on. The textmemos are between 2 and 250 lines. The headermemos are always
4 lines long.

The KeepTogether propertie of the headermemos are set to true and the
textmemos are set to false;

In some situations a header memo is printed on the bottom of a page and the
text on the next page.
I such situations i want to print the headermemo on the completly on next
page. ( no reprint! )

I cant use a regions because i get situations where the complete Region is
printed on the next page. So i get pages wich more than 50% empty.

Can anyone give me a solution for this problem?


Thanks for the support

Knut
(lambert@consilium.de)

Comments

  • edited April 2002
    You will have to check the position of the report engine's PrintPosRect,
    when the detail band prints, to see how far down the page it is generating
    in order to keep from orphaning a body memo from the header memo. Here is
    an example for a technique to print a header memo and body memo as you have
    described. The header will only print when the body memo can begin printing
    at the bottom of the page.

    http://www.digital-metaphors.com/tips/IndependentMemoKeepTogether.zip

    Cheers,

    Jim Bennett
    Digital Metaphors

  • edited April 2002
    Hi Jim,

    thanks for ?our support. How can i use this in a subreport. There is no
    propertie Engine in it.

    Knut Lambert
    CONSILIUM GmbH



  • edited April 2002
    There is an Engine property is on the Subreport.Report object. To use this
    technique in a subreport, I have uploaded a new version of the demo. Use
    the same link to download this version:

    http://www.digital-metaphors.com/tips/IndependentMemoKeepTogether.zip


    Cheers,

    Jim Bennett
    Digital Metaphors

  • edited April 2002
    Sorry Jim, i cant use your solution.

    some more Informations to my report.

    1.) The main Reprot contains 12 Subreprots PrintBehavior set to pbSection.
    2.) The mainreport has no heder- or footerband.
    3.) Each subreprot has its own header- and footerband.
    4.) Each subreport is totaly different form the others; the contens (all 12
    reports together) is a psychological certificate.
    5.) The user can deselct some of the subreprots.
    6.) One of the reports contains 12 ppMemos (not databound). The Text of the
    memeos is calculated before the
    memo is printed.

    When changing your example to this conditions (2,3) it cant work because of
    a missing Headerband
    in the mainreprot.

    When trying to change your code to the subreprot and the ppMemos, the
    variables
    (translated to your example) memHedaer.Top, MemHeader.Height,
    FMaxStartingPosition etc. containig
    the values i gave them in the designediotor. So the code dose nothing at
    all.

    I am dealing with this problem since two month and i cant find any solution.
    I have always the problem, that the variables


  • edited April 2002
    Sorry i pressed CTRL-RETURN

    -- variables (propertys) i dealing with contains not the values i found in
    the documentation or in
    other newsinfos.

    Hope you are patient and can gave me an other hint.

    Thanks so far

    Knut


  • edited April 2002
    I changed the demo a little to use a section style subreport and different
    timing to calculate the position. You will need to calculate the last
    possible starting position of the header memo in the
    Subreport.Report.OnStartPage event, because each subrepot can have
    headers/footers or none at all. Each subreport will have its own event
    handler in order to account for this. Essentially, use the approach that
    this demo takes in that you can calulate the last possible position on the
    page that the header memo can print, before it will not leave enough room
    for the next memo to print at least one line of text at the bottom of the
    page.


    Cheers,

    Jim Bennett
    Digital Metaphors

This discussion has been closed.