12345678910111213141516171819202122232425262728293031323334353637 |
- $PBExportHeader$f_rpt_sdw.srf
- $PBExportComments$由Column属性表产生dw语法--函数
- global type f_rpt_sdw from function_object
- end type
- forward prototypes
- global function string f_rpt_sdw (datawindow fdw)
- end prototypes
- global function string f_rpt_sdw (datawindow fdw);int li,li_cols,li_len,lx
- string ls_dw,ls_col1,ls_col2,ls_type,ls_name,ls_init,ls_alig
- li_cols=fdw.rowcount()
- if li_cols=0 then return ls_dw
- for li=1 to li_cols
- ls_type=fdw.object.ctype[li]
- ls_name=fdw.object.cname[li]
- li_len=f_clen(ls_type)
- if pos('number,decimal,long,ulong',left(ls_type,7))>0 then
- ls_alig='1'
- else
- ls_alig='0'
- end if
- ls_col1=ls_col1+char(13)+"column=(type="+ls_type
- ls_col1=ls_col1+" name="+ls_name
- ls_col1=ls_col1+' dbname="'+ls_name+'"'
- ls_init=fdw.object.cinitial[li]
- if ls_init>'' then ls_col1=ls_col1+' initial="'+ls_init+'"'
- ls_col1=ls_col1+')'
- ls_col2=ls_col2+"text(band=header alignment='2' text='"+ls_name+"' x='"+string(lx)+"' y='2' height='12' width='"+string(6*li_len)+"' name="+ls_name+"_t font.face='宋体' font.height='12' font.weight='400' font.family='0' font.pitch='2' font.charset='-122' background.color='16777215')"
- ls_col2=ls_col2+"column(band=detail id="+string(li)+" tabsequence="+string(li*10)+" alignment='"+ls_alig+"' x='"+string(lx)+"' y='2' height='14' width='"+string(6*li_len)+"' name="+ls_name+" edit.limit=0 edit.focusrectangle=yes edit.autoselect=yes font.face='宋体' font.height='12' font.weight='400' font.family='0' font.pitch='2' font.charset='-122' background.mode='1' background.color='16777215')"
- lx=lx+6*li_len+2
- next
- ls_dw="release 6;datawindow(units=1 timer_interval=0 color=16777215 processing=1 grid.lines=0) header(height=18 color='536870912') detail(height=20 color='536870912') table("+ls_col1+")"+ls_col2
- return ls_dw
- end function
|