?? 制作動(dòng)態(tài)報(bào)表.txt
字號(hào):
制作動(dòng)態(tài)報(bào)表:
procedure ttitlefrm.printview(t:string);//自定義過程,t為報(bào)表的標(biāo)題
var
dbtitle:Tqrlable;//動(dòng)態(tài)列標(biāo)題名
l,i:integer;//動(dòng)態(tài)數(shù)據(jù)顯示對(duì)象
s:string;//工作變量:l用來保存排列了列標(biāo)題名的總長度
const interval=60;//列之間的間隔
begin
l:=10;//從最左邊為10的地方開始放置列標(biāo)題名
i:=0;//l用來指示生成的列個(gè)數(shù)
repallfrm:=Trepallfrm.create(application);//創(chuàng)建報(bào)表窗體
repallfrm.titlelab.caption:=t;//報(bào)表的名字
with repallfrm do
//如果生成的列標(biāo)題名總長大于報(bào)表可容納的長度,或可用字段名已用完,則停止
dbtitle:=tqrlable.create(self);//創(chuàng)建列標(biāo)題名
dbtitle.paret:=headband1;//父對(duì)象為headband1
dbtitle.font.color:=cowhite;//字體為白色,以便和藍(lán)色的低相稱
dbtitle.transparent:=true;//設(shè)置為透明顯示
dbtitle.autosize:=true;//大小為自適應(yīng)
dbtitle.left:=1;//設(shè)置位置值
dbtitle.top:=10;
s:=mainfrm.dbtrid1.colums.items[i].fieldname;
dbtitle.caption:=s;//顯示主窗體中對(duì)象的字段名
dbtxt:Tqrdbtext.create(self);//父對(duì)象為qurband1
dbtxt.autosize:=true;
dbtxt.left:=1;
dbtxt.top:=10;
dbtxt.datase:=mainfrm.teble1;//數(shù)據(jù)集為主窗體中的table1
dbtxt.datafield:=s;//數(shù)據(jù)字段名
dbtxt.datafield:=s;//數(shù)據(jù)字段名
l:=l+dbtxt.width+interval;//記錄已經(jīng)安排的列標(biāo)題總長度
i:=i+1;//計(jì)數(shù)器加1
end;
repallfrm.quivkrep1.preview;//進(jìn)入報(bào)表預(yù)覽窗口
end;
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -