How To…Hide the Preview Toolbar Buttons

Question

“How do I control the toolbar buttons of the preview window in ReportBuilder?”

Solution

Use the OnPreviewFormCreate event to access the preview button pass-thru properties and control them any way you need.  You will need to type cast the TppReport.PreviewForm property to a TppPrintPreview object to access the button properties.

Download: PreviewHideButtons.zip

Sample Delphi code:

uses
  ppPrvDlg; 

procedure TForm1.ppReport1PreviewFormCreate(Sender: TObject);
begin

  //Hide Print Button
  TppPrintPreview(ppReport1.PreviewForm).PrintButton.Visible := not(CheckBox1.Checked);

end;