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

Limit memo stretching at the end of the last page - again.

edited January 2002 in General
I have used your example

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

to limit memo stretching at the end of the last page but when the report is
very complex
the memo is printed over a new page at the end of the report also if in the
previous page there is available space to print it.

I have debugged the function and i have noticed that the parameter
Report.Engine.PrintPosRect.Top don't change the value when some regions or
subreports are activated in the header band (using HeaderBeforeGenerate
event)

There is a solution to this behaviour ?

Thanks in advance.

Massimo.

Comments

  • edited January 2002
    In which event are you calling the PrintPosRect?


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited January 2002
    I have tried in the beforeprint and beforecreate event of the summary band
    and in the onprint event of the tppmemo component but the problem persist.

    Please note that when some regions or subreports in the header band are not
    visible, the memo is correctly printed.


    Thanks for your answer.



    "Jim Bennett (Digital Metaphors)" wrote
  • edited January 2002
    Ok, I'll try it out.


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited January 2002
    I added some dynamic height components in the header band, but I don't get
    any strange behavior. I added memos, regions and subreport in the header
    band. I set them to be visible in the HeaderBand.BeforeGenerate event.

    Can you modify the SummaryMemoOverflow demo and send this example to
    support@digital-metaphors.com ?


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited January 2002
    Forget about the example code to fix the height. Let the memo stretch
    dynamically and all you have to do is use the following two lines of code.
    This will fool the engine to do what you want:

    procedure TForm1.ppSummaryBand1AfterGenerate(Sender: TObject);
    begin
    ppSummaryBand1.OutOfSpace := False;
    ppSummaryBand1.OverFlow := False;
    end;


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited January 2002
    Excuse me but with this solution if for some reason the summary band must be
    printed over two or more pages, it will be truncated in one page.

    You can see this behaviour in my example when all regions and subreports are
    activated.

    Thanks.

    Massimo.


    "Jim Bennett (Digital Metaphors) wrote :
    band
    persist.
  • edited January 2002
    I thought that was the goal? Can you elaborate on the big picture of what
    the memo should do?


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited January 2002
    My goal is this: I must print in the last page at the end of the last row of
    the report a number of lines to fill the last page from the first blank row
    to the end of the page.

    I thought that the solution was to use a memo component as the last
    component of the summary in witch i have manually inserted 90 lines and then
    in the before print event of the summary band, stretch the memo to print
    only the rows of the memo that fit into the last page (without print a new
    page only with the residual lines).

    Please note that in the summary band, before the memo component are inserted
    regions and/or subreports components.

    Thank you for your attention.

    Massimo

    "Jim Bennett (Digital Metaphors)" wrote
  • edited January 2002
    I see the problem. There just needs to be a check to see if the memo is
    about to be printed in the summary band.


    procedure TForm1.ppMemo1Print(Sender: TObject);
    begin
    FMemoPrinted := True;
    end;

    procedure TForm1.ppSummaryBand1BeforeGenerate(Sender: TObject);
    begin
    FMemoPrinted := False;
    end;

    procedure TForm1.ppSummaryBand1AfterPrint(Sender: TObject);
    begin

    if FMemoPrinted then
    begin
    ppReport1.SummaryBand.OutOfSpace := False;
    ppReport1.SummaryBand.OverFlow := False;
    end;

    end;



    Cheers,

    Jim Bennett
    Digital Metaphors


This discussion has been closed.