Reorder pages after report generated

I saw this topic:

https://www.fast-report.com/en/forum/index....l=reorder+pages

But it appears to be referring to before the report is generated. I have a report that is basically invoices, some of which could be multi-page. After the report is generated, I would like to reorder the report to put all 1 page, then all 2 page, etc. I do not know how many pages an invoice will be until after it has been rendered.

So:

1) Is there a way to programmatically order pages after generated?
2) What is the best way to know that pages all belong to a specific ID (for instance, the best way to identify that pages 48, 49, and 50 are all customer X) - is there some page property I can set when it is being generated to help me out, or just use a hidden text field, etc?

Thank you in advance!

Ryan

Comments

  • gpigpi
    edited 1:23AM
    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;
    
  • edited 1:23AM
    Thanks! I'll give that a try!

    Ryan

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.