不知道你们在做票据打印时是否遇到过这种情况?如何解决?(100分)

  • 主题发起人 主题发起人 蜡笔小小新
  • 开始时间 开始时间

蜡笔小小新

Unregistered / Unconfirmed
GUEST, unregistred user!
在做票据打印时,在预览时显示票据边框文字,而在打印时不打印边框文字?用的是QuickReport.
不知如何解决.
 
换FASTREPORT即可
 
建议用RM
 
Try it:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;
implementation
uses Unit2;
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
QuickReport2.WantToPreview := True;
QuickReport2.Preview;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
QuickReport2.WantToPreview := False;
QuickReport2.Print;
end;

end.

unit Unit2;
interface
uses Windows, SysUtils, Messages, Classes, Graphics, Controls,
StdCtrls, ExtCtrls, Forms, QuickRpt, QRCtrls;
type
TQuickReport2 = class(TQuickRep)
QRBand1: TQRBand;
QRLabel1: TQRLabel;
procedure QRBand1BeforePrint(Sender: TQRCustomBand;
var PrintBand: Boolean);
procedure QRLabel1Print(sender: TObject;
var Value: String);
private
FWantToPreview: Boolean;
public
property WantToPreview: Boolean write FWantToPreview;
end;

var
QuickReport2: TQuickReport2;
implementation
{$R *.DFM}
procedure TQuickReport2.QRBand1BeforePrint(Sender: TQRCustomBand;
var PrintBand: Boolean);
begin
with QRBand1.Framedo
begin
DrawTop := FWantToPreview;
DrawLeft := FWantToPreview;
DrawBottom := FWantToPreview;
DrawRight := FWantToPreview;
end;
end;

procedure TQuickReport2.QRLabel1Print(sender: TObject;
var Value: String);
begin
if not FWantToPreview then
Value := '';
end;

end.
 
后退
顶部