T100——报表的小计数量、小计金额,总计金额
范例:cxmr540_g01
范例代码:
ON EVERY ROW
#add-point:rep.everyrow.before name="rep.everyrow.before"
####初始化
IF cl_null(g_i) THEN
LET g_i=0
END IF
IF cl_null(l_xjsl) THEN
LET l_xjsl=0
END IF
IF cl_null(l_xjmoney) THEN
LET l_xjmoney=0
END IF
LET g_i=g_i+1 ###记录当前分组行数
LET l_show='N'###是否显示本页小计
###计算本页小计
LET l_xjmoney= l_xjmoney+sr1.xmdl028
LET l_xjsl=l_xjsl+sr1.xmdl018
IF NOT g_i mod 10 THEN ####显示本页小计
LET l_show='Y'
END IF
IF sr1.xmdl005+1<=sr.getlength() THEN
IF NOT sr[sr1.xmdl005+1].l_px = sr1.l_px THEN
LET l_show='Y'
END IF
END IF
IF sr1.xmdl005=sr.getlength() THEN
LET l_show='Y'
END IF
PRINTX l_show,l_xjmoney,l_xjsl #####本页小计,总页数
IF NOT g_i mod 10 THEN
LET l_xjmoney=0
LET l_xjsl=0
END IF
IF sr1.xmdl005+1<sr.getlength() THEN
IF NOT sr[sr1.xmdl005+1].l_px = sr1.l_px THEN
LET l_xjmoney=0
LET l_xjsl=0
END IF
END IF
#end add-point:rep.everyrow.before
总计金额:
范例:
cinr301_g01_rep(sr1)下: DEFINE p_money_sum LIKE type_t.num20_6
BEFORE GROUP OF sr1.inbadocno下: LET p_money_sum=0
AFTER GROUP OF sr1.inbadocno下:LET p_money_sum = GROUP SUM(sr1.inbb011)
PRINTX p_money_sum