屏蔽qreport预览时的存盘,打印,打开文件等系统按钮 (30分)

  • 主题发起人 主题发起人 xuhuizhe
  • 开始时间 开始时间
X

xuhuizhe

Unregistered / Unconfirmed
GUEST, unregistred user!
请问高手
如何屏蔽qreport预览时的存盘,打印,打开文件等系统按钮
请给出这三个按钮逐个屏蔽的代码
 
我右键双击F1Book,怎么老是弹出F1Book的设计界面?
 
一个按钮十分吧!
 
一般都是写:
qR.Preview;
可是账单不可重复打印
又要可查到以前的账单
所以才有这样的难题
 
rocedure TForm1.Button1Click(Sender: TObject);
var
I : Integer;
prevfrm : TQRStandardPreview;
begin
quickRep1.PreviewModeless ;
for I := 0 to Screen.FormCount-1do
if Screen.Forms is TQRStandardPreview then
begin
prevfrm := TQRStandardPreview(Screen.Forms);
prevfrm.Print.Enabled := False;
prevfrm.PrintSetup.Enabled := False;
prevfrm.LoadReport.Enabled := false;
prevfrm.SaveReport.Enabled := False;
end;
end;
 
找到安装目录下的Qrprev.dfm,然后在对应的控件中添加
Visible = False
如不显示保存文件按钮,你可以修改为:
object SaveReport: TToolButton
Left = 239
Top = 0
Hint = 'Save Report'
Caption = 'PrintSetup'
ImageIndex = 10
OnClick = SaveClick
Visible = False //此项为添的内容
end
如果下次要恢复回来,只要删除就可以了
通过这样可以更改相对应的许多信息,如改为中文,
注意保存一个源文件
 
to:reallearning
编绎出错,用到TQRStandardPreview需要包含什么单元
to:lliuxxingw
我不想改变delphi系统,这会影响其它系统
 
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.

 
object Form1: TForm1
Left = 192
Top = 107
Width = 544
Height = 375
Caption = 'Form1'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
Scaled = False
OnCreate = FormCreate
PixelsPerInch = 96
TextHeight = 13
object QuickRep1: TQuickRep
Left = 120
Top = 88
Width = 794
Height = 1123
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = False
Frame.DrawLeft = False
Frame.DrawRight = False
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -13
Font.Name = 'Arial'
Font.Style = []
Functions.Strings = (
'PAGENUMBER'
'COLUMNNUMBER'
'REPORTTITLE')
Functions.DATA = (
'0'
'0'
'''''')
Options = [FirstPageHeader, LastPageFooter]
Page.Columns = 1
Page.Orientation = poPortrait
Page.PaperSize = A4
Page.Values = (
100
2970
100
2100
100
100
0)
PrinterSettings.Copies = 1
PrinterSettings.Duplex = False
PrinterSettings.FirstPage = 0
PrinterSettings.LastPage = 0
PrinterSettings.OutputBin = Auto
PrintIfEmpty = True
SnapToGrid = True
Units = MM
Zoom = 100
object TitleBand1: TQRBand
Left = 38
Top = 38
Width = 718
Height = 40
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = False
Frame.DrawLeft = False
Frame.DrawRight = False
AlignToBottom = False
Color = clWhite
ForceNewColumn = False
ForceNewPage = False
Size.Values = (
105.833333333333
1899.70833333333)
BandType = rbTitle
object QRLabel1: TQRLabel
Left = 168
Top = 16
Width = 58
Height = 17
Frame.Color = clBlack
Frame.DrawTop = False
Frame.DrawBottom = False
Frame.DrawLeft = False
Frame.DrawRight = False
Size.Values = (
44.9791666666667
444.5
42.3333333333333
153.458333333333)
Alignment = taLeftJustify
AlignToBand = False
AutoSize = True
AutoStretch = False
Caption = 'QRLabel1'
Color = clWhite
Transparent = False
WordWrap = True
FontSize = 10
end
end
end
object Button1: TButton
Left = 56
Top = 120
Width = 75
Height = 25
Caption = 'Button1'
TabOrder = 1
OnClick = Button1Click
end
end
 
感谢各位帮忙:
关键代码为
uses
QuickRpt, QRCtrls, ExtCtrls, QRPrntr, QRPrev;
Print.Enabled := False;
PrintSetup.Enabled := False;
LoadReport.Enabled := false;
SaveReport.Enabled := False;
我改为xxxx.visible:=false;
效果更佳
散分!!!
 

Similar threads

D
回复
0
查看
2K
DelphiTeacher的专栏
D
D
回复
0
查看
1K
DelphiTeacher的专栏
D
S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
D
回复
0
查看
2K
DelphiTeacher的专栏
D
后退
顶部