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

Force new page

edited March 2003 in General
Hi
I Have a report with 73 Line.
I need to spesify the position where teh program should go to the next page
There is a line number in the data.
so on the event Before Print of the detail line I would like to add some
code

If LineNo = 44
then .... ppreport1.????

Please help with this part

Edward Potgieter

Comments

  • edited March 2003
    You can try setting OutOfSpace to true on the detail band so that it thinks
    it can't fit on the current page. Use the DetailBand.BeforePrint event.
    Here is the code which breaks when the OrderNo = 1060 using the dbDemos
    database.


    procedure TForm1.ppReport1BeforePrint(Sender: TObject);
    begin
    FPageBreak := False;
    end;

    procedure TForm1.ppDetailBand1BeforePrint(Sender: TObject);
    begin
    if (ppReport1.DataPipeline['OrderNo'] = 1060) and not(FPageBreak) then
    begin
    ppDetailband1.OutOfSpace := True;
    FPageBreak := True;
    end

    else
    ppDetailband1.OutOfSpace := False;

    end;



    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited March 2003
    Where Does FPageBreak Come from ? I Can't Compile this example.
    If I Only set Out of space
    The report generate A lot of pages an it should only generate 2.

    Example

    Procedure TFrmReports.ppDetailBand1BeforePrint(Sender: TObject);
    begin
    IF QryDataLine.Value = 40
    then ppDetailBand1.OutOfSpace := True
    else ppDetailBand1.OutOfSpace := False ;
    end;


  • edited March 2003
    No solution
    Where does FPagebreak come from ?
    Report first page
    Generate LOTS of blank pages and not the last part

  • edited March 2003
    Sorry Solved the situation
    1 FPageBreak Delared as Var of type Boolean.
    2 Set to False on Start as example
    Check For > 39 ( Value set in Config Table for reports on my database )

    All work as planned
    thanks Edward Potgieter


  • edited March 2003
    Oh wonderfull, this I looked for a lon time....
    Erich Rieder
    Zurich


This discussion has been closed.