找回密码
 立即注册

QQ登录

只需一步,快速开始

Lenka.Guo 讲师达人认证 悬赏达人认证
超级版主   /  发表于:2022-3-2 17:04  /   查看:2100  /  回复:2
很多情况下,最终用户想将报表展示的数据导出后,进行存档或者二次数据处理,比如可能您需要将报表展示的结果导出到一个Excel 表单中,进行数据分析,比如创建为新的数据透视表,图表等,或者做二次的数据编辑。 ActiveReportsJS V3.0目前支持Excel 导出,但暂不支持将所有的数据导出单个Sheet中。为了解决该问题,我们推出了基于表格类的数据导出,支持将表格或矩表数据导出为CSV格式。
如果报表包含了多个表格或矩表,会自动导出为ZIP包,您可以很容易地将表格式数据导出的输出导入到Excel表格中。
操作步骤:
1. 引入js文件
cdn地址:
  1. <span style="background-color: rgb(255, 255, 254); color: rgb(0, 0, 0); font-family: Consolas, &quot;Courier New&quot;, monospace; white-space: pre;">  </span><span style="font-family: Consolas, &quot;Courier New&quot;, monospace; white-space: pre; color: rgb(56, 56, 56);"><</span><span style="font-family: Consolas, &quot;Courier New&quot;, monospace; white-space: pre; color: rgb(128, 0, 0);">script</span><span style="background-color: rgb(255, 255, 254); color: rgb(0, 0, 0); font-family: Consolas, &quot;Courier New&quot;, monospace; white-space: pre;"> </span><span style="font-family: Consolas, &quot;Courier New&quot;, monospace; white-space: pre; color: rgb(255, 0, 0);">src</span><span style="font-family: Consolas, &quot;Courier New&quot;, monospace; white-space: pre; color: rgb(56, 56, 56);">=</span><span style="font-family: Consolas, &quot;Courier New&quot;, monospace; white-space: pre; color: rgb(0, 0, 255);">"</span>https://cdn.grapecity.com/activereportsjs/3.0.0/dist/ar-js-tabular-data.js<span style="font-family: Consolas, &quot;Courier New&quot;, monospace; white-space: pre; color: rgb(0, 0, 255);">"</span><span style="font-family: Consolas, &quot;Courier New&quot;, monospace; white-space: pre; color: rgb(56, 56, 56);">></</span><span style="font-family: Consolas, &quot;Courier New&quot;, monospace; white-space: pre; color: rgb(128, 0, 0);">script</span><span style="font-family: Consolas, &quot;Courier New&quot;, monospace; white-space: pre; color: rgb(56, 56, 56);">></span>
复制代码
2. CSV 导出可配置项

属性名称
类型
描述

colSeparator
string
设置 CSV 文件的列分隔符

rowSeparator
string
设置 CSV 文件的行分隔符

quotationSymbol
string
设置包含值的字符,如用引号包含

outputType
'zip' or 'plain'
设置输出类型是zip还是Plain,如果包含多个表格或矩表,且设置输出类型为zip,则每个表格会保存为一个单独的文件。

tableSeparator
string
如果设置输出类型为Plain则需要设置表格分隔符



3. Viewer Setting设置

const settings = {                       tabular-data: {                    outputType: "plain", // 或zip                                                   tableSeparator: '-',                                       quotationSymbol: ''',                    rowSeparator: '',                    colSeparator: ''                }};function load() {                const viewer = new ActiveReports.Viewer('#ARJSviewerDiv', { ExportsSettings: settings });                viewer.open('/reports/Fonts.rdlx-json');                }

2 个回复

倒序浏览
dongguac10
注册会员   /  发表于:2022-8-18 22:26:18
沙发
学习了,辛苦辛苦。
回复 使用道具 举报
Bella.YuanWyn认证
超级版主   /  发表于:2022-8-19 08:40:38
板凳
dongguac10 发表于 2022-8-18 22:26
学习了,辛苦辛苦。

回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部