string ls_syntax, ls_width, ls_codetype
SELECT byfq_input_card INTO :ls_codetype FROM byfq_tableinfo WHERE byfq_tablename = :as_tablename AND byfq_tabletype = '1';
ls_width = f_get_token( ls_codetype, "_" )
IF ls_width = '' THEN ls_width = '4'
as_tablename = Lower( as_tablename )
ls_syntax = 'release ' + is_ver + ';~r~n'
ls_syntax = ls_syntax + 'datawindow(units=0 timer_interval=0 color=12632256 processing=1' + &
' print.documentname=""' + &
' print.orientation = 0 print.margin.left = 110 print.margin.right = 110 print.margin.top = 96 print.margin.bottom = 96' + &
' print.paper.source = 0 print.paper.size = 0 print.prompt=no print.buttons=no print.preview.buttons=no' + &
' grid.lines=0 selected.mouse=no )~r~n'
ls_syntax = ls_syntax + 'header(height=76 color="536870912" )~r~n'
ls_syntax = ls_syntax + 'summary(height=0 color="536870912" )~r~n'
ls_syntax = ls_syntax + 'footer(height=0 color="536870912" )~r~n'
ls_syntax = ls_syntax + 'detail(height=88 color="536870912" )~r~n'
ls_syntax = ls_syntax + 'table(' + &
'column=(type=char(' + ls_width + ') update=yes updatewhereclause=yes key=yes name=byfq_code dbname="' + as_tablename + '.byfq_code" )~r~n' + &
'column=(type=char(40) update=yes updatewhereclause=yes name=byfq_value dbname="' + as_tablename + '.byfq_value" )~r~n' + &
'column=(type=char(1) update=yes updatewhereclause=yes name=byfq_isuse dbname="' + as_tablename + '.byfq_isuse" initial="1" values="常用 1/常用 0" )~r~n' + &
'column=(type=char(240) update=yes updatewhereclause=yes name=byfq_comment dbname="' + as_tablename + '.byfq_comment" )~r~n' + &
'column=(type=char(10) update=yes updatewhereclause=yes name=byfq_othercode dbname="' + as_tablename + '.byfq_othercode" )~r~n'
ls_syntax = ls_syntax + 'retrieve="PBSELECT( VERSION(400) TABLE(NAME=~~"' + as_tablename + '~~" )' + &
' COLUMN(NAME=~~"' + as_tablename + '.byfq_code~~")' + &
' COLUMN(NAME=~~"' + as_tablename + '.byfq_value~~")' + &
' COLUMN(NAME=~~"' + as_tablename + '.byfq_isuse~~")' + &
' COLUMN(NAME=~~"' + as_tablename + '.byfq_comment~~")' + &
' COLUMN(NAME=~~"' + as_tablename + '.byfq_othercode~~"))' + &
' ORDER(NAME=~~"' + as_tablename + '.byfq_code~~" ASC=yes )' + &
'" update="' + as_tablename + '" updatewhere=1 updatekeyinplace=no )~r~n'
ls_syntax = ls_syntax + 'text(band=header alignment="2" text="代码"border="6" color="0" x="9" y="8" height="60" width="315" name=byfq_code_t font.face="宋体" font.height="-10" font.weight="400" font.family="0" font.pitch="2" font.charset="134" background.mode="1" background.color="536870912" )~r~n' + &
'text(band=header alignment="2" text="代码表达的含义"border="6" color="0" x="334" y="8" height="60" width="649" name=byfq_value_t font.face="宋体" font.height="-10" font.weight="400" font.family="0" font.pitch="2" font.charset="134" background.mode="1" background.color="536870912" )~r~n' + &
'text(band=header alignment="2" text="常用"border="6" color="0" x="992" y="8" height="60" width="224" name=byfq_isuse_t font.face="宋体" font.height="-10" font.weight="400" font.family="0" font.pitch="2" font.charset="134" background.mode="1" background.color="536870912" )~r~n' + &
'text(band=header alignment="2" text="说明"border="6" color="0" x="1550" y="8" height="60" width="2231" name=byfq_comment_t font.face="宋体" font.height="-10" font.weight="400" font.family="0" font.pitch="2" font.charset="134" background.mode="1" background.color="536870912" )~r~n' + &
'text(band=header alignment="2" text="标准代码"border="6" color="0" x="1225" y="8" height="60" width="325" name=byfq_comment_t font.face="宋体" font.height="-10" font.weight="400" font.family="0" font.pitch="2" font.charset="134" background.mode="1" background.color="536870912" )~r~n' + &
'column(band=detail id=1 alignment="1" tabsequence=10 border="5" color="0" x="9" y="8" height="72" width="315" format="[general]" name=byfq_code tag="代码" edit.limit=' + &
ls_width + ' edit.case=any edit.focusrectangle=no edit.autoselect=yes edit.autohscroll=yes font.face="宋体" font.height="-10" font.weight="400" font.family="0" font.pitch="2" font.charset="134" background.mode="1" background.color="536870912" )~r~n' + &
'column(band=detail id=2 alignment="1" tabsequence=20 border="5" color="0" x="334" y="8" height="72" width="649" format="[general]" name=byfq_value tag="代码表达的含义" edit.limit=40 edit.case=any edit.focusrectangle=no edit.autoselect=yes edit.autohscroll=yes font.face="宋体" font.height="-10" font.weight="400" font.family="0" font.pitch="2" font.charset="134" background.mode="1" background.color="536870912" )~r~n' + &
'column(band=detail id=3 alignment="1" tabsequence=30 border="0" color="0" x="997" y="8" height="72" width="219" format="[general]" name=byfq_isuse tag="常用" checkbox.text="常用" checkbox.on="1" checkbox.off="0" checkbox.scale=no checkbox.threed=yes font.face="宋体" font.height="-10" font.weight="400" font.family="0" font.pitch="2" font.charset="134" background.mode="1" background.color="536870912" )~r~n' + &
'column(band=detail id=4 alignment="0" tabsequence=50 border="0" color="0" x="1550" y="8" height="72" width="2231" format="[general]" name=byfq_comment tag="说明" edit.limit=240 edit.case=any edit.focusrectangle=no edit.autoselect=yes edit.autohscroll=yes font.face="宋体" font.height="-10" font.weight="400" font.family="0" font.pitch="2" font.charset="134" background.mode="1" background.color="536870912" )~r~n' + &
'column(band=detail id=5 alignment="1" tabsequence=40 border="5" color="0" x="1225" y="8" height="72" width="325" format="[general]" name=byfq_othercode tag="标准代码" edit.limit=40 edit.case=any edit.focusrectangle=no edit.autoselect=yes edit.autohscroll=yes font.face="宋体" font.height="-10" font.weight="400" font.family="0" font.pitch="2" font.charset="134" background.mode="1" background.color="536870912" )~r~n' + &
'htmltable(border="1" cellpadding="0" cellspacing="0" generatecss="no" nowrap="yes")~r~n'
dw_1.Create( ls_syntax )
dw_1.SetTransObject( sqlca )
IF dw_1.Retrieve() <= 0 THEN dw_1.InsertRow(0)
return 1
---------------------------------------------------------------
global type f_createextenddw from function_object
end type
forward prototypes
global function string f_createextenddw (ref datawindow dw, string cols[])
end prototypes
global function string f_createextenddw (ref datawindow dw, string cols[]);string sql_dw_general, sql_dw_columns_type, sql_dw_headers_conf, sql_dw_columns_conf, ls_errors
int i
long ll_colcount
string ls_colnametype
string ls_colname,ls_coltype
long ll_pos
ll_colcount = upperbound(cols)
//generals
sql_dw_general = "release 8;" &
+ "datawindow(units=0 timer_interval=0 color=16777215 processing=0 print.documentname=" + char(34) + "" + char(34) + " print.orientation = 0 print.margin.left = 110 print.margin.right = 110 print.margin.top = 96 print.margin.bottom = 96 print.paper.source = 0 print.paper.size = 0 print.prompt=no print.buttons=no print.preview.buttons=no )" &
+ "header(height=72 color=" + char(34) + "536870912" + char(34) + " )" &
+ "summary(height=0 color=" + char(34) + "536870912" + char(34) + " )" &
+ "footer(height=0 color=" + char(34) + "536870912" + char(34) + " )" &
+ "detail(height=84 color=" + char(34) + "536870912" + char(34) + " )"
//列及类型
sql_dw_columns_type = "table("
FOR I=1 to ll_colcount
ls_colnametype = trim(cols[i])
ls_colname = right(ls_colnametype,len(ls_colnametype) - 1)
ls_coltype = left(ls_colnametype,1)
choose case upper(ls_coltype)
case 'C'
ls_coltype = 'char(100)'
case 'D'
ls_coltype = 'date'
case 'N'
ls_coltype = 'decimal(6)'
case else
ls_coltype = 'char(100)'
end choose
//ls_coltype = 'char(100)'
//列及类型
sql_dw_columns_type= sql_dw_columns_type + "colu
动态创建external数据窗口的程序
最新推荐文章于 2023-07-10 07:15:00 发布