f_rpt_sdw.srf 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. $PBExportHeader$f_rpt_sdw.srf
  2. $PBExportComments$由Column属性表产生dw语法--函数
  3. global type f_rpt_sdw from function_object
  4. end type
  5. forward prototypes
  6. global function string f_rpt_sdw (datawindow fdw)
  7. end prototypes
  8. global function string f_rpt_sdw (datawindow fdw);int li,li_cols,li_len,lx
  9. string ls_dw,ls_col1,ls_col2,ls_type,ls_name,ls_init,ls_alig
  10. li_cols=fdw.rowcount()
  11. if li_cols=0 then return ls_dw
  12. for li=1 to li_cols
  13. ls_type=fdw.object.ctype[li]
  14. ls_name=fdw.object.cname[li]
  15. li_len=f_clen(ls_type)
  16. if pos('number,decimal,long,ulong',left(ls_type,7))>0 then
  17. ls_alig='1'
  18. else
  19. ls_alig='0'
  20. end if
  21. ls_col1=ls_col1+char(13)+"column=(type="+ls_type
  22. ls_col1=ls_col1+" name="+ls_name
  23. ls_col1=ls_col1+' dbname="'+ls_name+'"'
  24. ls_init=fdw.object.cinitial[li]
  25. if ls_init>'' then ls_col1=ls_col1+' initial="'+ls_init+'"'
  26. ls_col1=ls_col1+')'
  27. 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')"
  28. 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')"
  29. lx=lx+6*li_len+2
  30. next
  31. 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
  32. return ls_dw
  33. end function