$PBExportHeader$w_rpt_groupc.srw $PBExportComments$创建分组--窗口 forward global type w_rpt_groupc from Window end type type cb_2 from commandbutton within w_rpt_groupc end type type cb_1 from commandbutton within w_rpt_groupc end type type dw2 from datawindow within w_rpt_groupc end type type dw1 from datawindow within w_rpt_groupc end type end forward global type w_rpt_groupc from Window int X=27 int Y=336 int Width=2043 int Height=1428 boolean TitleBar=true string Title="分组选择" long BackColor=12632256 boolean ControlMenu=true WindowType WindowType=response! cb_2 cb_2 cb_1 cb_1 dw2 dw2 dw1 dw1 end type global w_rpt_groupc w_rpt_groupc type variables int i,ii_parm end variables on w_rpt_groupc.create this.cb_2=create cb_2 this.cb_1=create cb_1 this.dw2=create dw2 this.dw1=create dw1 this.Control[]={this.cb_2,& this.cb_1,& this.dw2,& this.dw1} end on on w_rpt_groupc.destroy destroy(this.cb_2) destroy(this.cb_1) destroy(this.dw2) destroy(this.dw1) end on event open;string ls_objs,ls_obj int li_pos,li_row dwobject ldwo f_wcenter(this) ii_parm=message.DoubleParm w_rpt_main.dw3.Rowscopy(1,w_rpt_main.dw3.rowcount(),Primary!,dw1,1,Primary!) if ii_parm=2 then//可以改为detail区的字段或计算字段 title='压缩列选择' ls_objs=w_rpt_main.is_sparse+char(9) do while true li_pos=pos(ls_objs,char(9))//tab if li_pos=0 then exit ls_obj=trim(left(ls_objs,li_pos -1)) ls_objs=mid(ls_objs,li_pos+1) li_row=dw1.find("cname='"+ls_obj+"'",1,9999) if li_row>0 then dw1.event doubleclicked(0,0,li_row,ldwo) loop end if end event type cb_2 from commandbutton within w_rpt_groupc int X=1120 int Y=1200 int Width=247 int Height=108 int TabOrder=11 string Text="取消" int TextSize=-9 int Weight=400 string FaceName="宋体" FontPitch FontPitch=Variable! end type event clicked;close(parent) end event type cb_1 from commandbutton within w_rpt_groupc int X=640 int Y=1200 int Width=247 int Height=108 int TabOrder=10 string Text="确认" int TextSize=-9 int Weight=400 string FaceName="宋体" FontPitch FontPitch=Variable! end type event clicked;string ls[2] w_rpt_main.ii_save=1 if ii_parm=2 then//压缩列 for i=1 to dw2.rowcount() ls[2]=ls[2]+char(9)+dw2.getitemstring(i,'cname') next w_rpt_main.is_sparse=mid(ls[2],2) close(parent) else for i=1 to dw2.rowcount() ls[1]=ls[1]+'+'+dw2.getitemstring(i,'ctag') ls[2]=ls[2]+'+'+dw2.getitemstring(i,'cname') next closewithreturn(parent,mid(ls[1],2)+';;'+mid(ls[2],2)) end if end event type dw2 from datawindow within w_rpt_groupc int X=1024 int Y=12 int Width=983 int Height=1140 int TabOrder=20 string DataObject="dw_rpt_column" boolean HScrollBar=true boolean VScrollBar=true boolean HSplitScroll=true boolean LiveScroll=true end type event doubleclicked;if row>0 then i=dw1.rowcount() dw2.RowsMove(row,row,primary!,dw1,i+1,Primary!) end if end event type dw1 from datawindow within w_rpt_groupc int X=18 int Y=12 int Width=983 int Height=1140 int TabOrder=30 string DataObject="dw_rpt_column" boolean HScrollBar=true boolean VScrollBar=true boolean HSplitScroll=true boolean LiveScroll=true end type event doubleclicked;if row>0 then i=dw2.rowcount() dw1.RowsMove(row,row,primary!,dw2,i+1,Primary!) end if end event