有時我們在編寫PB程序時,需要在datawindow數據窗口中添加一個計算域或者直線,這如何進行呢?
//怎樣在程序中為datawindow加計算域或line?
//以下程序加一計算域sum(dept_id for all)
string ls_modrow
dw_1.Modify("DataWindow.summary.Height=64")
ls_modrow = 'Create compute(band=summary font.charset="0" font.face="MS Sans Serif" font.family="2" font.height="-8" font.pitch="2" font.weight="400" background.mode="1" background.color="536870912" color="0" x="9" y="4" height="52" width="297" format="[general]" expression="sum(dept_id for all)" alignment="1" border="0" crosstab.repeat=no )~r~n'
dw_1.modify( ls_modrow )
//以下程序加一條線
string ls_line
dw_1.Modify("DataWindow.detail.Height=332")
ls_line = 'Create line(band=detail background.mode="2" background.color="16777215" pen.style="0" pen.width="5" pen.color="0" x1="37" y1="320" x2="1458" y2="316" )~r~n'
dw_1.modify( ls_line )
dw_1.settransobject(sqlca)
dw_1.retrieve()
新聞熱點
疑難解答