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
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
<!--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