Two Pass report and masterdata over more than 1 page detection?

Fast-Reports 5.6.8 in Tokyo

I have a need to modify headers when data cross over in the next page and so on. Basically i need to modify a part of a memo field on the header
to say "continued on next page" , sounds silly but what I have to duplicate from a very old report.

I figure I have to do a two pass report possibly, then on one of the events of the header to check the masterdata band to see if it passes over into more than 1 page.

So if it crossed 3 pages

I would see something like

My Header text < Continued on next page >

My Header text < Continued on next page >

My Header text

That way first 2 pages get the < Continued on next page > added, while the 3rd page being the final page it was on, doesn't need it as it ended there.

Comments

  • gpigpi
    edited 10:52PM
    Try to check current <Page> in the TfrxMasterData OnBeforePrint and OnAfterPrint events on the first pass
  • edited 10:52PM
    gpi wrote: »
    Try to check current <Page> in the TfrxMasterData OnBeforePrint and OnAfterPrint events on the first pass

    Hmmm ok.... possibly I guess could use a preset variable to store? So first time its set thats the inital page its on... then on the other pages it checks to see to compare its page to the stored one to determine?

    Ill see what I can go from there.
  • edited 10:52PM
    Still can't get it....

    I can get it so a variable is set the first time to store the page #

    then any page after that just compares its active page # to the one stored. If its greater than, modify the header.

    I can get it working on the the 2page and so on... but can't nail down the 1st page know theres gonna be a 2nd page to it.

    This is lazy mock up of what i'm trying to do.

    6af94b7b0d7aabd6a62fc16743b31054.png

    The first page of the data knows there is a second page to it... so the first page header will have that note that this data band is continued to next page.

    On the 2nd page in this instance, is the last page of the data. So there is no need for a modified header.. its "done" now.

  • gpigpi
    edited 10:52PM
    Use TfrxHeader and TfrxFooter bands for masterdata for several records. Get <Page> value before header/footer print
  • edited 10:52PM
    gpi wrote: »
    Use TfrxHeader and TfrxFooter bands for masterdata for several records. Get <Page> value before header/footer print

    Tried for about 3 hours today.. still no go. About 15 hrs into this now.

    Just cant figure out how to make the very first instance of the header to change if there is more data to be printed for that band.

    I've come up with 1001 ways to do this for every page after the first page instance.. but never can seem to trigger something to happen on the first page instance.

    Even tried to hook into the query object to check record number vs record count.

    My footer is only at the very end. So i can't use that to trigger anything.

    You can't have dual header / footer for the same band.

    100% stumped here.

    Only thing I can think of is when the footer is hit, if there is anyway via the script language access each instance of my header for that band. So if five instances of it, the first four get modified to say "continued" on them while
    leaving the 5th instance alone.

    I am sure its something stupid simple but can't for life of me figure out wtf to do >
  • gpigpi
    edited 10:52PM
    See a sample for FRDemo in the attach
  • edited 10:52PM
    gpi wrote: »
    See a sample for FRDemo in the attach

    The demo worked.. but once I tried it in my report, i get the on every page instance.. from first instance to last instance.
  • edited 10:52PM
    Ok after some schooling....

    Two Pass Report
    Footer I store <Page> as hEndPage Variable

    then on the 2nd pass on my label I want to modify
    procedure lbl_GrossSalesFrontOfficeInvoicesOnBeforePrint(Sender: TfrxComponent);
    begin
       if <Page> = hEndPage then
        begin
          lbl_GrossSalesFrontOfficeInvoices.top := 16.25;                                                     
          lbl_GrossSalesFrontOfficeInvoices.text  := 'Gross Sales: Front Office Invoices';
          lbl_GrossSalesFrontOfficeInvoices.height := 15.12;                                                  
        end else
         begin
          lbl_GrossSalesFrontOfficeInvoices.top := 16.25 - 15.12;                                                                 
          lbl_GrossSalesFrontOfficeInvoices.text  := 'Gross Sales: Front Office Invoices'+#10+'        ( continued on next page )';    
          lbl_GrossSalesFrontOfficeInvoices.height := 30.24;                                                  
         end;     
    end;
    

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.