L
liusa
Unregistered / Unconfirmed
GUEST, unregistred user!
请教各位高手:
我在QuickReport的OnNeedDate事件中控制了一下最后一页PageFooter的高度,语句执行无误,高度倒是变了,可就是打到页外面去了,Why?
我用的是QR3.05 for D4。
程序如下:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
QuickRpt, Qrctrls, StdCtrls, ExtCtrls;
type
TForm1 = class(TForm)
QuickRep1: TQuickRep;
Button1: TButton;
DetailBand1: TQRBand;
PageFooterBand1: TQRBand;
QRLabel1: TQRLabel;
QRLabel2: TQRLabel;
procedure QuickRep1BeforePrint(Sender: TCustomQuickRep;
var PrintReport: Boolean);
procedure QuickRep1NeedData(Sender: TObject; var MoreData: Boolean);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
PLines:integer;
implementation
{$R *.DFM}
procedure TForm1.QuickRep1BeforePrint(Sender: TCustomQuickRep;
var PrintReport: Boolean);
begin
PLines:=0;
end;
procedure TForm1.QuickRep1NeedData(Sender: TObject; var MoreData: Boolean);
begin
PLines:=PLines+1;
moredata:=PLines<34;
if not moredata then
begin
PageFooterBand1.Height:=2*PageFooterBand1.Height;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
QuickRep1.Preview;
end;
end.
我在QuickReport的OnNeedDate事件中控制了一下最后一页PageFooter的高度,语句执行无误,高度倒是变了,可就是打到页外面去了,Why?
我用的是QR3.05 for D4。
程序如下:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
QuickRpt, Qrctrls, StdCtrls, ExtCtrls;
type
TForm1 = class(TForm)
QuickRep1: TQuickRep;
Button1: TButton;
DetailBand1: TQRBand;
PageFooterBand1: TQRBand;
QRLabel1: TQRLabel;
QRLabel2: TQRLabel;
procedure QuickRep1BeforePrint(Sender: TCustomQuickRep;
var PrintReport: Boolean);
procedure QuickRep1NeedData(Sender: TObject; var MoreData: Boolean);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
PLines:integer;
implementation
{$R *.DFM}
procedure TForm1.QuickRep1BeforePrint(Sender: TCustomQuickRep;
var PrintReport: Boolean);
begin
PLines:=0;
end;
procedure TForm1.QuickRep1NeedData(Sender: TObject; var MoreData: Boolean);
begin
PLines:=PLines+1;
moredata:=PLines<34;
if not moredata then
begin
PageFooterBand1.Height:=2*PageFooterBand1.Height;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
QuickRep1.Preview;
end;
end.