做表格报表,一条记录占一行表格,如果一页未占满记录,剩下的空白区,(50分)

H

hqlww

Unregistered / Unconfirmed
GUEST, unregistred user!
fastreport 用overlay band , reportbuilder 用 pagestyle 画一张表
类似背景一样,与数据表格重合。qreport也用overlay类似的东西。
或者用临时表,不够一页的纪录数,添空纪录。
 
不明白???
 
自已再添些空白数据吧!
哈哈,算算记录数,除以每页的记录数!
 
FastReport里有个"自动追加空行"的功能。(AutoAppendBlank)
 
如果是采用quickreport报表形式,该如何实现?
并且是在哪个事件中实现的?
 
用冷叶风的办法,在BeforePrint事件中添加空白记录,
AfterPrint事件中把空白记录删除。
例如:
procedure TForm2.AddRecord;
var
i: integer;
begin
with DMForm.CountTbl2do
begin
try
DisableControls;
if (RecordCount mod 15) <> 0 then
^^每页15行
for i := 1 to ((RecordCount div 15) + 1) * 15 - RecordCountdo
begin
Append;
FieldByName('Code').AsString := '';
Post;
end;
finally
EnableControls;
end;
end;
end;

procedure TForm2.DelRecord;
var
i: integer;
begin
with DMForm.CountTbl2do
begin
try
DisableControls;
Last;
while FieldByName('Code').AsString='' and Bofdo

begin
Delete;
Last;
end;
finally
EnableControls;
end;
end;
end;

以上方法对TQuery不适用。
 
不用删除吧?
TQuery的CachedUpdated为True, UpdateObjects设一个空的TUpdateSQL,
TQuery也适用了
 
d6 2000 通过
procedure TForm1.DetailBand1AfterPrint(Sender: TQRCustomBand;
BandPrinted: Boolean);
begin
with QuickRep1.DataSetdo
begin
if not eof then
begin
Next;
if eof then
begin
QRDBText1.Parent:=nil;
{ QRDBText2.Parent:=nil;
QRDBText3.Parent:=nil;
QRDBText4.Parent:=nil;
QRDBText5.Parent:=nil;
}
if (QuickRep1.Page.Length
-QuickRep1.Page.TopMargin
-QuickRep1.Page.BottomMargin
-QuickRep1.CurrentY >20 ) then
//剩余空间
Prior;
end
else
Prior;
end;
end;
end;

procedure TForm1.QuickRep1BeforePrint(Sender: TCustomQuickRep;
var PrintReport: Boolean);
begin
QRDBText1.Parent:=DetailBand1;
{ QRDBText2.Parent:=DetailBand1;
QRDBText3.Parent:=DetailBand1;
QRDBText4.Parent:=DetailBand1;
QRDBText5.Parent:=DetailBand1;
}
end;
 
这个问题也可以用自画的方式来处理,下个星期我把原来作的一个报表打印的程序给你贴上来。[:)][:)]
 
搬個板凳來聽課。
 
我也遇到这个问题,AutoAppendBlank在band属性页里找不到,netatom,说说你的具体方法
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
D
回复
0
查看
2K
DelphiTeacher的专栏
D
I
回复
0
查看
874
import
I
顶部