unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, QuickRpt, QRCtrls, ExtCtrls, QRPrntr, QRPrev;
type
TForm1 = class(TForm)
QuickRep1: TQuickRep;
TitleBand1: TQRBand;
QRLabel1: TQRLabel;
Button1: TButton;
procedure FormCreate(Sender: TObject);
procedure NotifyEvent(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
screen.OnActiveFormChange := NotifyEvent;
end;
procedure TForm1.NotifyEvent(Sender: TObject);
begin
if screen.ActiveForm = nil then
exit;
if screen.ActiveForm is TQRStandardPreview then
with TQRStandardPreview(screen.ActiveForm)do
begin
Print.Enabled := False;
PrintSetup.Enabled := False;
LoadReport.Enabled := false;
SaveReport.Enabled := False;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
QuickRep1.Preview;
end;
end.