sdta 版主:
Local lcBkkm,lcKddm,lcStr
Store "" To lcBkkm,lcKddm,lcStr
Create Cursor Tj (考点代码 C(5),科目 C(10))
Select * From ls2 Into Cursor Temp
Scan
For lnI=1 To Alines(Abkkm,Alltrim(报考科目),",")
Insert Into Tj Values (Temp.报名点代码,Abkkm[lnI])
If Not Alltrim(Abkkm[lnI])$lcBkkm
lcBkkm=lcBkkm+Iif(Empty(lcBkkm),"",",")+Alltrim(Abkkm[lnI])+" N(4)" && 提取报考科目
EndIf
EndFor
Endscan
Messagebox(lcBkkm)
Create Cursor Tjb (考点代码 C(5),&lcBkkm,小计 N(5))
Select 考点代码,科目,Count(*) 人数 From Tj Group By 1,2 Into Cursor Temp
Scan
If Alltrim(考点代码)==lcKddm
Else
Insert Into Tjb (考点代码) Values (Temp.考点代码)
EndIf
Replace (temp.科目) With temp.人数 For Alltrim(考点代码)==Alltrim(Temp.考点代码) In Tjb
lcKddm=Alltrim(考点代码)
Endscan
Insert Into Tjb (考点代码) Values ("合计")
Select Tjb
For lnI=2 To Fcount()-1
lcStr=lcStr+Field(lnI)+Iif(lnI<Fcount()-1,"+","")
Sum Evaluate(Field(lnI)) To X
Messagebox( Evaluate(Field(lnI)),0,"代码结果3")&&我在此处插入此代码,看一下结果,消息框提示是0
是何原因?
Replace Record Reccount() (Field(lnI)) With X && 列合计
EndFor
Replace All (Field(Fcount())) With Evaluate(lcStr) && 行小计
Browse
Local lcBkkm,lcKddm,lcStr
Store "" To lcBkkm,lcKddm,lcStr
Create Cursor Tj (考点代码 C(5),科目 C(10))
Select * From ls2 Into Cursor Temp
Scan
For lnI=1 To Alines(Abkkm,Alltrim(报考科目),",")
Insert Into Tj Values (Temp.报名点代码,Abkkm[lnI])
If Not Alltrim(Abkkm[lnI])$lcBkkm
lcBkkm=lcBkkm+Iif(Empty(lcBkkm),"",",")+Alltrim(Abkkm[lnI])+" N(4)" && 提取报考科目
EndIf
EndFor
Endscan
Messagebox(lcBkkm)
Create Cursor Tjb (考点代码 C(5),&lcBkkm,小计 N(5))
Select 考点代码,科目,Count(*) 人数 From Tj Group By 1,2 Into Cursor Temp
Scan
If Alltrim(考点代码)==lcKddm
Else
Insert Into Tjb (考点代码) Values (Temp.考点代码)
EndIf
Replace (temp.科目) With temp.人数 For Alltrim(考点代码)==Alltrim(Temp.考点代码) In Tjb
lcKddm=Alltrim(考点代码)
Endscan
Insert Into Tjb (考点代码) Values ("合计")
Select Tjb
For lnI=2 To Fcount()-1
lcStr=lcStr+Field(lnI)+Iif(lnI<Fcount()-1,"+","")
Sum Evaluate(Field(lnI)) To X
Messagebox( Evaluate(Field(lnI)),0,"代码结果3")&&我在此处插入此代码,看一下结果,消息框提示是0
Replace Record Reccount() (Field(lnI)) With X && 列合计
EndFor
Replace All (Field(Fcount())) With Evaluate(lcStr) && 行小计
Browse