Interleaved pages in report like Rave

Hi,
I am converting an invoice report from Rave and want to print the invoice data on the page front and the contract terms on the back of each invoice page. The contract terms are one page long. I have the report set to duplex so that the following happens:

Invoice start (page 1), Contract on back; --> First 2-sided Page
Invoice continuation (page 2), Contract on back; --> Second 2-sided Page
Invoice continuation (page 3),Contract on back... --> Third 2-sided Page
...and so on until all invoice pages printed.

In Rave there is a report property called "GoTo Mode" you can set to "gmCallEach". It will print the named "GoTo Page in between every page.

This is a deal breaker for me. The invoice must look the same or will be rejected by my client.

I do not expect the exact functionality, but how would I do this with Fast Reports say with SubReports so some such? It just has to look right, I do not care how we get there.

Comments

  • gpigpi
    edited 3:38AM
    You can resort preview pages after report's preparing
    var i, j: integer;
        page : TfrxReportPage;
    begin
         frxReport1.PrepareReport();
         j := frxReport1.PreviewPages.Count div 2;
         page := TfrxReportPage.Create(nil);
         for i := 0 to j - 2 do
           begin
             page.AssignAll(frxReport1.PreviewPages.Page[j + i]);
             frxReport1.PreviewPages.AddEmptyPage(i * 2 + 1);
             frxReport1.PreviewPages.ModifyPage(i * 2 + 1, page);
             frxReport1.PreviewPages.DeletePage(j + i + 1);
           end;
         page.Free;  
         frxReport1.ShowPreparedReport;
    end;
    
  • LurkingKiwiLurkingKiwi Wellington, New Zealand
    edited March 2017
    gpi wrote: »
    You can resort preview pages after report's preparing
    Would it be possible to just print the contract page once, as the last page, and then go through inserting the blank pages and using ModifyPage(i * 2 + 1, page); on each blank page with the same cached "page"?
    Something like (untested):
    var i, j: integer;
        page : TfrxReportPage;
    begin
         frxReport1.PrepareReport();
         j := frxReport1.PreviewPages.Count - 1;
         page := TfrxReportPage.Create(nil);
         page.AssignAll(frxReport1.PreviewPages.Page[j]);
         for i := 0 to j - 2 do
           begin
             frxReport1.PreviewPages.AddEmptyPage(i * 2 + 1);
             frxReport1.PreviewPages.ModifyPage(i * 2 + 1, page);
           end;
         page.Free;  
         frxReport1.ShowPreparedReport;
    end;
    
  • gpigpi
    edited 3:38AM
    wrote:
    Would it be possible to just print the contract page once, as the last page, and then go through inserting the blank pages and using ModifyPage(i * 2 + 1, page); on each blank page with the same cached "page"?
    Yes, if contract page have static content
  • LurkingKiwiLurkingKiwi Wellington, New Zealand
    edited 3:38AM
    gpi wrote: »
    gpi wrote: »
    Would it be possible to just print the contract page once, as the last page, and then go through inserting the blank pages and using ModifyPage(i * 2 + 1, page); on each blank page with the same cached "page"?
    Yes, if contract page have static content
    Excellent! That should both simplify and speed up a couple of my reports, where I have a generic "competition-wide" result page and a "team-specific" result page back-to-back!

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.