[这个贴子最后由yrjc5在 2006/08/23 10:55pm 第 1 次编辑]
我的公式如下请指教: delfor(gridname) and selectfill("入库明细","商品代码","商品代码") and selectfill("出库明细","商品代码","商品代码",2) and DelReptRows("进销存","商品代码") And SetColFormula(GridName,"退_数量","") And SetColFormula(GridName,"退_金额","") And SetColFormula(GridName,"次品数量_已理赔","") And SetColFormula(GridName,"次品数量_现存","") And SetColFormula(GridName,"商品类别","[商品代码管理!商品类别]") AndSetColFormula(GridName,"商品名称","[商品代码管理!商品名称]") And SetColFormula(GridName,"花纹规格","[商品代码管理!花纹规格]") And SetColFormula(GridName,"商品规格","[商品代码管理!商品规格]") And SetColFormula(GridName,"存_数量","SumFor(""入库明细"",""入库数量"",""商品代码"" ,""="" ,[商品代码]) - SumFor(""出库明细"",""出库数量"",""商品代码"" ,""="" ,[商品代码],""出库用途"", ""<>"" ,""质量冲红"",""出库用途"", ""<>"" ,""质量商品出库"")")and SetVariable("%表位置数%",1)And SetLabel("表@","") And SetLabel("标题@","正在统计"+GridName+"表,请稍候…")ANDSetVariable("%开始行数%",1) And SetVariable("%字符数%",1) And Loop("[%字符数%] <= 20 And [%表位置数%]<Grids+10","if(Int(Countfor(GridName)/ 20) <= 1,SetVariable(""%结束行数%"",2), SetVariable(""%结束行数%"",Int(Countfor (GridName )/20)+1))And RecalcRow(GridName,[%开始行数%],[%开始行数%]+[%结束行数%]) And SetVariable(""%百分%"", Int([%字符数%] * 100 / 20) )And SetLabel(""表%"",TEXT([%百分%])+""%"") And SetLabel(""表@"",Rept(""■"",[%字符数%])) And SetVariable(""%开始行数%"",[%开始行数%]+[%结束行数%]) And SetVariable(""%字符数%"",[%字符数%]+1) ") And IF([%表位置数%]>=Grids+10,SetLabel("标题@"," 当前计算已停止!"), SetLabel("标题@","统计"+GridName+"完毕!")) AndSetVariable("%表位置数%",-1) and delfor(gridname,"商品代码","=","") And DelFor("进销存","商品类别", "=" ,"") And SortCol("进销存","商品名称",2) And SortCol("进销存","商品类别",2) And subtotal("商品名称","进_数量,销_金额,销_数量,存_数量","2,2,2,2",0) and msgbox("计算完成!",0)
|