Reorder pages

Is it possible to create a new page in code, and have it displayed as the first page?

I have a multi-page report, and depending on certain conditions, I may need to create a page in code and display it as the first page. Presently, I'm doing the following:

procedure TForm7.frxReport1BeginDoc(Sender: TObject);
var
APage: TfrxReportPage;
begin
APage := TfrxReportPage.Create(frxReport1);
APage.CreateUniqueName;

AMemo := TfrxMemoView.Create(APage);
AMemo.CreateUniqueName;
...
end;


However, this page is always displayed as the last page. Any way I can get it to display as the first page?

Thanks in advance.

Comments

  • gpigpi
    edited 7:55AM
    Use
    frxReport1.Objects.Move(frxReport1.Objects.IndexOf(frxReport1.Pages[frxReport1.PagesCount - 1]), 1);

Leave a Comment