Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- procedure TForm1.frxReport1Preview(Sender: TObject);
- var Button: TSpeedButton;
- begin
- Button := TSpeedButton.Create(TfrxPreviewForm(TfrxReport(Sender).PreviewForm).ToolBar);
- TfrxPreviewForm(TfrxReport(Sender).PreviewForm).ToolBar.InsertControl(Button);
- Button.Caption := 'Refresh';
- Button.Width := 60;
- Button.OnClick := RefreshReport;
- end;
- procedure TForm1.RefreshReport(Sender: TObject);
- var
- idx: Integer;
- begin
- for idx := 0 to frxReport1.PagesCount - 1 do
- if frxReport1.Pages[idx] is TfrxReportPage then
- begin
- frxReport1.Pages[idx].Clear;
- frxReport1.Pages[idx].AssignAll(frxReport2.Pages[idx], True);
- end;
- TfrxPreviewForm(TSpeedButton(Sender).Owner.Owner).Report.ShowReport;
- end;
- procedure TForm1.FormCreate(Sender: TObject);
- begin
- frxReport2.AssignAll(frxReport1, True);
- frxReport1.EngineOptions.DestroyForms := False;
- frxReport1.ShowReport();
- end;
Add Comment
Please, Sign In to add comment