“详细资料”右键->格式化节->详细资料->选中“在后面页新建面”并点击“X+2”那个按钮->在下面的文本框输入:RecordNumber mod 12 = 0
12表示一页12条记录
表达式中用whileprintingrecords进行统计
建个公式字段 Basic语法 Formual=RecordNumber
在网上找了下资料,http://www.cnblogs.com/laughterwym/archive/2007/02/17/651826.aspx 跟我要做的是一样的,但是上面说的代码好象有问题, formula_2 whileprintingrecords; global numbervar BFtotal; global numbervar RStotal; global numbervar BTtotal; BFtotal:=BFtotal+{VIEW1.保费}; RStotal:=RStotal+1; BTtotal:=BTtotal+{VIEW1.补贴};红色行,是不能那样计算的,{}号里的是字段,这样相加语法是有错误的
建个公式字段 Basic语法 Formual=RecordNumber 将字段放在页脚就可以了呀
建三个fomula字段@1,@2,@3 (crystal语法) @1的内容 whileprintingrecords; global numbervar ptotal; ptotal:=0;@2的内容 whileprintingrecords; global numbervar ptotal; ptotal := ptotal + 1;@3的内容 whileprintingrecords; global numbervar ptotal;把@1放在Page Header节,并设置隐藏 把@2放在Details节,并设置隐藏 把@3放在Page Footer节 @3就是你要显示的每页Details中记录数。
12表示一页12条记录
Basic语法
Formual=RecordNumber
跟我要做的是一样的,但是上面说的代码好象有问题,
formula_2
whileprintingrecords;
global numbervar BFtotal;
global numbervar RStotal;
global numbervar BTtotal;
BFtotal:=BFtotal+{VIEW1.保费};
RStotal:=RStotal+1;
BTtotal:=BTtotal+{VIEW1.补贴};红色行,是不能那样计算的,{}号里的是字段,这样相加语法是有错误的
Basic语法
Formual=RecordNumber
将字段放在页脚就可以了呀
@1的内容
whileprintingrecords;
global numbervar ptotal;
ptotal:=0;@2的内容
whileprintingrecords;
global numbervar ptotal;
ptotal := ptotal + 1;@3的内容
whileprintingrecords;
global numbervar ptotal;把@1放在Page Header节,并设置隐藏
把@2放在Details节,并设置隐藏
把@3放在Page Footer节
@3就是你要显示的每页Details中记录数。
我是需要统计某一列在本页显示的数据啊,且每页很有可能显示的行数是不一样的;
@2的内容
whileprintingrecords;
global numbervar ptotal;
ptotal := ptotal + 1; 这个是不符合要求啊
因为有的行是那列是没有数据的,所以就不用把这行统计进来
递增前判断数据是否达到满足要求例如:字符串类型
if length{某字段}>0
ptotal:=ptotal+1
本页统计数据现在是对了,非常感谢你的指导;
现在还剩下一个问题:就是:
把@1放在Page Header节,并设置隐藏
把@2放在Details节,并设置隐藏
把@3放在Page Footer节 我是这么放的,但是我不知道怎么将@1和@2设置隐藏 .请再次指教,谢谢
在@1的格式设定中有个suppress属性(抑制显示的意思),打上勾就可以了
@2也同样处理