|
将DW数据窗口导出为EXCEL文件的方法(整理)(11) s_zw = ds_excel.uf_globalreplace(s_zw,"~n","") s_zw = ds_excel.uf_globalreplace(s_zw," ","") s_zw = ds_excel.uf_globalreplace(s_zw,'"',"") Long l_newrow l_newrow = ds_excel.InsertRow(0) ds_excel.SetItem(l_newrow, "colname",s_name) ds_excel.SetItem(l_newrow, "x",l_x) ds_excel.SetItem(l_newrow, "coltype",s_type) ds_excel.SetItem(l_newrow, "coltitle",s_zw) ds_excel.SetItem(l_newrow, "objtype",s_objtype) END IF LOOP //排序,设置到列数组中 ds_excel.SetSort("x a") ds_excel.Sort() FOR i_cnt = 1 TO ds_excel.RowCount() is_columnname[i_cnt] = Lower(ds_excel.GetItemString(i_cnt,'colname')) is_columntitle[i_cnt] = ds_excel.GetItemString(i_cnt,'coltitle') is_columntype[i_cnt] = ds_excel.GetItemString(i_cnt,'objtype') s_datatype = Left(Lower(ds_excel.GetItemString(i_cnt,'coltype')),4) CHOOSE CASE s_datatype CASE 'char','varc','int','long' is_columnformat[i_cnt] = 'G/通用格式' //特别指定日期专用格式为 char(10) s_datatype = Lower(ds_excel.GetItemString(i_cnt,'coltype')) IF s_datatype = 'char(10)' THEN is_columnformat[i_cnt] = 'yyyy""年""m""月""d""日""' END IF CASE 'deci' is_columnformat[i_cnt] = "0.00_ " CASE 'date','datetime' is_columnformat[i_cnt] = 'yyyy""年""m""月""d""日""' CASE 'time' is_columnformat[i_cnt] = 'h""时""mm""分""ss""秒""' CASE ELSE is_columnformat[i_cnt] = 'G/通用格式' END CHOOSE NEXT IF IsValid(ds_excel) THEN DESTROY ds_excel END IF
RETURN 1 end function on nvo_excel.create call super::create
|