報表窗體repForm中的部件及屬性設置如下:
部件 屬性及屬性值
Query1: TQuery DatabaseName:d:\sb
Active: True
Qrep1: TQuickrep Dataset:query1
TitleBand1: TQRBand BandType:rbTitle
HeadBand1: TQRBand BandType:rbColumnHeader
DrawLeft : True
DrawRight : True
DrawTop : True
DrawBottom : True
DetailBand1: TQRBand BandType:rbDetail
DrawLeft : True
DrawRight : True
DrawTop : True
DrawBottom : True
ChildBand1: TQRChildBand ParentBand:DetailBand1
DrawLeft : True
DrawRight : True
DrawTop : True
DrawBottom : True
TitleLabel: TQRLabel Caption:設備統計表
DlmcLabel: TQRLabel Caption:類別
SbxhLabel: TQRLabel Caption:型號
SbpzLabel: TQRLabel Caption:配置
SbslLabel: TQRLabel Caption:數量
DlmcDBText: TQRDBText Dataset:Query1
DatafIEld: dlmc
SbxhDBText: TQRDBText Dataset:Query1
DatafIEld: sbxh
SbpzDBText: TQRDBText Dataset:Query1
DatafIEld: sbpz
SbslDBText: TQRDBtext Dataset:Query1
DatafIEld: sbsl
Shape1~9: TQRShape Shape:qrsVertline
Top:0
Width:1
Query1的SQL屬性設置為:
select a.dlbh,a.dlmc,b.sbxh,b.sbpz,b.sbsl
from dlbmk a,sbxhk b
where a.dlbh=b.dlbh and b.xhbm not in
(select xhbm from bmsbk where trim(bmmc)$#@60;$#@62;’電腦部’)
order by a.dlbh
設置幾個TQRband部件的DrawLeft、DrawRight、DrawTop、DrawBottom屬性值為True,是為了打印表格邊框及橫線。利用TQRShape部件,是為了打印出表格豎線。DlmcDBText放置在DetailBand1上,其它幾個TQRDBText部件放置在ChildBand1上,Shape1~3放置在HeadBand1上,Shape4~6放置在DetailBand1上,Shape7~9放置在ChildBand1上。