Delphi 6 + QuickReport – Removing or Disabling the Save and Load Buttons during preview [solved]

This has been an age old question that one needs to tackle if you have clients that want to control data coming in and out of the company.

That is why I am quite happy and relieved to have found it as well.

Without further adue, here it is

uses
, QRPrntr, QRPrev;

procedure TqrpLabelGrader.QuickRep1Preview(Sender: TObject);
var
  qrStandardPreview: TQRStandardPreview;
begin
  //, QRPrntr, QRPrev;
  qrStandardPreview:=TQRStandardPreview.CreatePreview(Self, TQRPrinter(Sender));
  qrStandardPreview.SaveReport.Enabled := False;
  qrStandardPreview.LoadReport.Enabled := False;
  qrStandardPreview.Show;
end;

Enjoy

Coffee Cup

Delphi Quickreport Disabling Load and Save buttons [SOLVED]

A recent client of mine insisted that he wanted the app to remove the load and save button for the quickreports.

After searching for around 2 hours, i found the solution from mr.wu

So thank you mr.wu

Here is the code

another way can solve this problem.
(1)append
    uses  ...QRPrntr, QRPrev,...
(2)complete the OnPreview method for the QuickRep as following:
procedure TqrpLabelGrader.QuickRep1Preview(Sender: TObject);
var
  qrStandardPreview: TQRStandardPreview;
begin
  qrStandardPreview:=TQRStandardPreview.CreatePreview(Self, TQRPrinter(Sender));
  qrStandardPreview.SaveReport.Enabled := False;
  qrStandardPreview.LoadReport.Enabled := False;
  qrStandardPreview.Show;
end;
HPH,
wu yong

Enjoy

Coffee Cup

http://www.delphigroups.info/2/b2/390705.html