Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

OnStartGenerateReport, OnEndGenerateReport, OnGenerateReportProgress Example

The following example demonstrates organization of the indicator that appears when building a report as an independent form. This form contains only one control – TProgressBar, has no border icons, and its border style is equal to bsDialog. Indicator form is created on starting report generation and is closed when the report has been generated.

Delphi
// Creates a form with a progress indicator
procedure TForm1.dxComponentPrinter1StartGenerateReport(Sender: TObject;  AReportLink: TBasedxReportLink);
begin
  Form2 := TForm2.Create(Application);
  Form2.Show;
end;
// Sets the indicator's value according to the report generation process
procedure TForm1.dxComponentPrinter1GenerateReportProgress(Sender: TObject; AReportLink: TBasedxReportLink; APercentDone: Double);
begin
  Form2.ProgressBar1.Position := Round(APercentDone);
  Form2.Repaint;
end;
// Closes the form containing the progress indicator
procedure TForm1.dxComponentPrinter1EndGenerateReport(Sender: TObject; AReportLink: TBasedxReportLink);
begin
  Form2.Close;
end;