Re-arrange pages in template

Hi,
I have a 10 page report template.

I'm just wondering if there is a way to re-arrange the pages programatically?

Example: Set page number 1 to page 10. Page 2 then becomes page 1, page 3 becomes page 2, page 4 becomes page 3...etc

Comments

  • Anu de DeusAnu de Deus Hampshire, UK
    edited July 2009
    I did a function specially for that. It applies to any FR object, not only pages:

    <!--fonto:Courier New--><span style="font-family:Courier New"><!--/fonto-->procedure TRptBuilder.SetComponentOrder(c: TfrxComponent; pOrder: Integer);
    begin
    if (c <> nil) and (c.Parent <> nil) then
    begin
    c.Parent.Objects.Remove( c );
    c.Parent.Objects.Insert(pOrder, c);
    end;
    end;<!--fontc--></span><!--/fontc-->

    Usage:
    <!--fonto:Courier New--><span style="font-family:Courier New"><!--/fonto-->SetComponentOrder(frxPage10, 1); <!--fontc--></span><!--/fontc-->/// moves your frxPage10 (whatever position it is now) to position 1.
    Note that position 0 is the Data page, I wouldn't touch that one, so move your pages to positions from 1 to higher numbers.

    I just wish this was:
    - already included in the FR libraries
    - documented somewhere.

    Cheers
  • edited 6:19PM
    Thanks for the help. My software design has changed since then and thus I will not be re-arranging the pages. However what you provided may be helpful later on. Great work.

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.