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

Page Break

edited October 2002 in General
Hi All

I want to add a page break after every detail band. I don't want to have to
do this in code but if its the only way, I will. I cannot achieve this by
inserting a dummy group as I then have issues with a dynamic sort ordering
system that I am passing in.

Thanks in advance

AndyFlan

Comments

  • edited October 2002
    Create a group on a custom component (TppLabel) that changes value every
    time the detail band prints. Then you can change the text value in the
    OnGetText event handler of the label. This way the group will always have a
    different group break value and you will get your page breaks for your new
    page group.


    Cheers,

    Jim Bennett
    Digital Metaphors

  • edited October 2002
    as I said, the dummy group method is no good to me.

    Thanks

    AndyFlan

  • edited October 2002
    The only other option is to set DetailBand.OutOfSpace to true. Here is the
    code. Basically, use the Report.OnStartPage to set a variable to have the
    first detail on the page print. After that, the detail band will be told not
    to print again on that page.

    ...
    private
    FOutOfSpace: boolean;
    end;

    var
    Form1: TForm1;

    implementation

    {$R *.dfm}

    procedure TForm1.Button1Click(Sender: TObject);
    begin
    ppReport1.Print;
    end;

    procedure TForm1.ppReport1StartPage(Sender: TObject);
    begin
    FOutOfSpace := False;
    end;

    procedure TForm1.ppDetailBand1AfterPrint(Sender: TObject);
    begin
    FOutOfSpace := True;
    end;

    procedure TForm1.ppDetailBand1BeforePrint(Sender: TObject);
    begin
    ppDetailband1.OutOfSpace := FOutOfSpace;
    end;


    You can also try using the PageBreak component from the RBAddOn component
    set. www.bancoems.com\RBAddOn.htm

    Cheers,

    Jim Bennett
    Digital Metaphors

  • edited October 2002
    Cheers Jim, Didn't even look at RB Add On, we have that as well......

    Andrew Flannery


This discussion has been closed.