NewPage and ShowBand at the same time?

edited 12:20PM in FastReport 2.xx VCL
On Report I have this bands:
PageHeader
MasterData
DetailHeader
DetailData
DetailFooter
PageFoter

In MaserData I have only one record, in DetailData more then 20 records

I need to set insert pagebreak with DetailHeader on new page when comes DetailData record number 6. I try with OnBeforePrint on DetailData:
if [LINE#] = 6 then begin
   NewPage;
   ShowBand(DetailHeader);
end;
But this shows band DetailHeader on previous page and 6th record on new page. Is this OK? I expected DetailHeader on new page.

Otzi

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 12:20PM
    Hi Otzi
    add a boolean variable set it's value to false at start of report, in obp of master set it to true, reset it to false in a detail footer.
    test it in obp of pageheader and if true try calling showband there.

    I usually add a child band attached to the pageheader which duplicates the header I want and just control it's visibility as required.
    regards ;)

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.