string ls_sql,ls_syntax,ls_err,ls_present
string gzxmmc[],cur_bm,all_gzxmmc
int i,rows
cur_bm=trim(ddlb_1.text)
cb_7.triggerevent(clicked!)
select count(*) into :rows from gzxmgl where 部门=:cur_bm and 日期=:cur_date;
declare cur_gzxmmc cursor for select 工资项目名称 from gzxmgl where 部门=:cur_bm and 日期=:cur_date;
open cur_gzxmmc;
for i=1 to rows
fetch cur_gzxmmc into :gzxmmc[i];
if i=1 then
all_gzxmmc=gzxmmc[1]
else
all_gzxmmc=all_gzxmmc+","+gzxmmc[i]
end if
next
ls_sql="select 编号,姓名,"+all_gzxmmc+",出勤天数,应发工资,扣除工资,实发工资 from gz_info"
ls_present='style(type=grid)'
ls_syntax=sqlca.syntaxfromsql( ls_sql,ls_present,ls_err)
dw_1.create(ls_syntax,ls_err)
dw_1.settransobject(sqlca)
dw_1.retrieve( )
这是创建动态数据窗口对象的代码