打印报表–分片重复报表
概述
分片重复:将报表按片重复显示出来,一张报表的纵向或横向或双向同时被分成了多个区域,往往每个区域来自不同的数据源。
应用场景
如下图所示,展示不同订单编号的订单统计表。
示例说明
数据准备
配置了2个数据集
在数据面板中添加数据集,可选择Json数据集和Http接口数据集,Json数据如下图所示:
[{"订单编号":"A0001","订单日期":45051,"订购数量":45,"订单名称":"订单1","订单金额":149,"到货日期":45055,"订单统计表":"订单统计表"},{"订单编号":"A0002","订单日期":45052,"订购数量":23,"订单名称":"订单2","订单金额":156,"到货日期":45056,"订单统计表":"订单统计表"},{"订单编号":"A0003","订单日期":45053,"订购数量":67,"订单名称":"订单3","订单金额":854,"到货日期":45057,"订单统计表":"订单统计表"},{"订单编号":"A0004","订单日期":45054,"订购数量":15,"订单名称":"订单4","订单金额":157,"到货日期":45058,"订单统计表":"订单统计表"},{"订单编号":"A0005","订单日期":45055,"订购数量":67,"订单名称":"订单5","订单金额":642,"到货日期":45059,"订单统计表":"订单统计表"},{"订单编号":"A0006","订单日期":45056,"订购数量":89,"订单名称":"订单6","订单金额":945,"到货日期":45060,"订单统计表":"订单统计表"}]
在数据面板中添加数据集,可选择Json数据集和Http接口数据集,order1的Json数据如下图所示:
[{"二维码":"码100201","订单编号":"A0001"},{"二维码":"码100202","订单编号":"A0002"},{"二维码":"码100203","订单编号":"A0003"},{"二维码":"码100204","订单编号":"A0004"},{"二维码":"码100205","订单编号":"A0005"},{"二维码":"码100206","订单编号":"A0006"}]
报表设计
将order数据集中的数据字段拖入到A1、B3、B4、B6、D3、D6单元格,order1数据集中的数据字段拖入到E4单元格,并将单元格设置为向下扩展,将B3、B4、B5、D6表格设置成分组,D4、B6设置成汇总,按图中颜色添加分组,如下图所示:
效果预览
分片重复演示.json
https://www.yuque.com/attachments/yuque/0/2023/json/25420404/1687832589613-75b2790f-ddb7-474b-b4d4-55c2d1548524.json
参考文档
- 小智报表样例源码下载
- https://gitee.com/tizdata_admin/vue-xzreport-example.git
- 小智报表demo体验
- https://xzdemo.tizdata.com/#/imbedShow/reportExample
- 丰富的报表模板示例
- 小智报表在线试用
- https://xzreport.com
- 小智报表js sdk下载
- https://tizdata.com/xzdownload/
- 开发使用文档
- https://doc.tizdata.com/xiaozhi/650