水晶报表 分页 的问题
水晶报表分页汇总
建三个公式字段,第一个(公式1)输入下面的公式:
whileprintingrecords;
global numbervar ptotal;
ptotal:=0;
第二个(公式2)输入下面的公式:
whileprintingrecords;
global numbervar ptotal;
ptotal := ptotal + [要汇总的字段];
如果要汇总的字段不是数字,就用tonumber()函数转换;
第三个(公式3)输入下面的公式:
whileprintingrecords;
global numbervar ptotal;
把公式1放在页眉,公式2放在详细资料,并隐藏公式1和公式2;把公式3放在页脚,格式公式3,设置为你要显示的格式。这样就行了。
水晶报表分页并自动插入空白行
在论坛上经常会看到水晶报表分页的问题,这个很好解决。
但是自动插入空白行的问题却一直没有很好的答案,
经过研究找到一个变通的办法来实现了。
'分页
在详细资料上点格式化节,在后面页新建页打勾
公式中输入:
if onlastrecord then
formula = false
else
if recordnumber mod 5 =0 then
formula = true
else
formula = false
end if
end if
'(basic 语法)
---------------------------------------------------------------------
最后页不足,用空行填充:
新增一个空白详细资料行,格式化此节,在抑制显示(无深化)打勾
公式中输入:
if not onlastrecord then
formula = true
else
if (recordnumber mod 5 <= 1) then '第一个,1
formula = true
else
formula = false
end if
end if
'(basic 语法)
...接着第二个[ 新增一个空白详细资料行,格式化此节,在抑制显示(无深化)打勾 ]:
公式中输入:
if not onlastrecord then
formula = true
else
if (recordnumber mod 5 <= 2) then '第二个,2
formula = true
else
formula = false
end if
end if
...接着第三个[ 新增一个空白详细资料行,格式化此节,在抑制显示(无深化)打勾 ]:
公式中输入:
if not onlastrecord then
formula = true
else
if (recordnumber mod 5 <= 3) then '第三个,3
formula = true
else
formula = false
end if
end if
在论坛上经常会看到水晶报表分页的问题,这个很好解决。
但是自动插入空白行的问题却一直没有很好的答案,
经过研究找到一个变通的办法来实现了。
'分页
在详细资料上点格式化节,在后面页新建页打勾
公式中输入:
if onlastrecord then
formula = false
else
if recordnumber mod 5 =0 then
formula = true
else
formula = false
end if
end if
'(basic 语法)
---------------------------------------------------------------------
最后页不足,用空行填充:
新增一个空白详细资料行,格式化此节,在抑制显示(无深化)打勾
公式中输入:
if not onlastrecord then
formula = true
else
if (recordnumber mod 5 <= 1) then '第一个,1
formula = true
else
formula = false
end if
end if
'(basic 语法)
...接着第二个[ 新增一个空白详细资料行,格式化此节,在抑制显示(无深化)打勾 ]:
公式中输入:
if not onlastrecord then
formula = true
else
if (recordnumber mod 5 <= 2) then '第二个,2
formula = true
else
formula = false
end if
end if
...接着第三个[ 新增一个空白详细资料行,格式化此节,在抑制显示(无深化)打勾 ]:
公式中输入:
if not onlastrecord then
formula = true
else
if (recordnumber mod 5 <= 3) then '第三个,3
formula = true
else
formula = false
end if
end if
...(同理第四个,即最后5-1个)
(注:此方法适用于行数较少,上面是为5行为例,不过不觉得麻烦,对行数较多也可以用)...(同理第四个,即最后5-1个)
上一篇: 永别了:iPhone 11全系砍掉3D Touch
下一篇: 华为激进:多款5G手机现身蓝牙认证库
推荐阅读
-
SpringBoot项目中分页插件PageHelper无效的问题及解决方法
-
EF core的原生SQL查询以及用EF core进行分页查询遇到的问题
-
怎么解决wordpress分页title标题重复不利于SEO的问题
-
mysql一对多关联查询分页错误问题的解决方法
-
使用kibana可视化报表实时监控你的应用程序,从日志中找出问题,解决问题
-
水晶报表 分页 的问题
-
使用mybatis分页插件PageHelper5.1.2遇到的问题
-
使用mybatis分页插件PageHelper5.0.0遇到的问题总结
-
Ireport生成pdf格式的报表中的中文乱码问题解决办法
-
Springboot 整合通用mapper和pagehelper展示分页数据的问题(附github源码)