ActiveReports 报表控件V12新特性 -- 新增JSON和CSV导出
来源:互联网 发布:阿里云香港服务器快吗 编辑:程序博客网 时间:2024/06/03 14:58
ActiveReports是一款专注于 .NET 平台的报表控件,全面满足 HTML5 / WinForms / ASP.NET / ASP.NET MVC / WPF 等平台下报表设计和开发工作需求,作为专业的报表工具为全球超过 300,000 开发人员提供了全面的报表开发服务。
最新发布的ActiveReports 12推出了两种新的导出模式 JSON和CSV, 这些导出功能类似于我们的其他接口,如PDF,Doc,Docx和HTML,只需要几行代码,就可以实现。
一、 导出 JSON
JSON(JavaScript Object Notation) 是一种轻量级的数据交换格式。JSON采用完全独立于语言的文本格式,这些特性使JSON成为理想的数据交换语言
1、在报表设计器中导出JSON模式,具体操作如下:
2、代码中实现:
// Provide the page report you want to render.GrapeCity.ActiveReports.PageReport report = new GrapeCity.ActiveReports.PageReport();GrapeCity.ActiveReports.Document.PageDocument reportDocument = newGrapeCity.ActiveReports.Document.PageDocument(report);// Create an output directory.System.IO.DirectoryInfo outputDirectory = new System.IO.DirectoryInfo(@"C:\MyJSON");outputDirectory.Create();// Provide settings for your rendering output.GrapeCity.ActiveReports.Export.Text.Page.JsonRenderingExtension.Settings jsonSettings =new GrapeCity.ActiveReports.Export.Text.Page.JsonRenderingExtension.Settings();jsonSettings.Formatted = true;// Set the rendering extension and render the report.GrapeCity.ActiveReports.Export.Text.Page.JsonRenderingExtension jsonRenderingExtension= new GrapeCity.ActiveReports.Export.Text.Page.JsonRenderingExtension();GrapeCity.ActiveReports.Rendering.IO.FileStreamProvider outputProvider = newGrapeCity.ActiveReports.Rendering.IO.FileStreamProvider(outputDirectory,System.IO.Path.GetFileNameWithoutExtension(outputDirectory.Name));// Overwrite output file if it already exists.outputProvider.OverwriteOutputFile = true;reportDocument.Render(jsonRenderingExtension, outputProvider, jsonSettings);
二、 导出CSV
CSV逗号分隔值文件(Comma Separated value),是一种用来存储数据的纯文本文件格式。CSV是一种通用的文件格式,它可以非常容易的被导入各种PC表格及数据库中,CSV文件中的一行即就是数据表中的一行。
1、在报表设计器中导出CSV模式,具体操作如下:
2、代码中实现:
// Provide the page report you want to render.GrapeCity.ActiveReports.PageReport report = new GrapeCity.ActiveReports.PageReport();GrapeCity.ActiveReports.Document.PageDocument reportDocument = newGrapeCity.ActiveReports.Document.PageDocument(report);// Create an output directory.System.IO.DirectoryInfo outputDirectory = new System.IO.DirectoryInfo(@"C:\MyCSV");outputDirectory.Create();// Provide settings for your rendering output.GrapeCity.ActiveReports.Export.Text.Page.CsvRenderingExtension.Settings csvSettings =new GrapeCity.ActiveReports.Export.Text.Page.CsvRenderingExtension.Settings();csvSettings.ColumnsDelimiter = ",";csvSettings.RowsDelimiter = "\r\n";csvSettings.QuotationSymbol = '"';csvSettings.Encoding = Encoding.UTF8;// Set the rendering extension and render the report.GrapeCity.ActiveReports.Export.Text.Page.CsvRenderingExtension csvRenderingExtension =new GrapeCity.ActiveReports.Export.Text.Page.CsvRenderingExtension();GrapeCity.ActiveReports.Rendering.IO.FileStreamProvider outputProvider = newGrapeCity.ActiveReports.Rendering.IO.FileStreamProvider(outputDirectory,System.IO.Path.GetFileNameWithoutExtension(outputDirectory.Name));// Overwrite output file if it already exists.outputProvider.OverwriteOutputFile = true;reportDocument.Render(csvRenderingExtension, outputProvider, csvSettings);
定制培训加量全心送!凡在2017年12月31日之前,购买葡萄城控件团队授权和企业授权的用户,不仅可以享受到优惠的价格,还可获赠葡萄城技术专家根据客户项目需求提供的定制培训服务。老客户推荐新客户成单,也将获得“客户推荐双重感恩礼”。
点击此处,了解更多。
关于葡萄城报表
葡萄城报表是一套强大的报表开发和系统搭建工具,既能与您开发的报表软件项目紧密集成,也可独立部署运行,支持多数据源,具有无编码、灵活、稳定等特性,可以帮您快速搭建专业的报表软件系统,实现各类报表的设计、管理、权限控制、数据填报、负载均衡及跨平台发布。
千万种报表,同一种选择!获知葡萄城报表更多详情,请访问如下网站:
了解报表开发控件:http://www.gcpowertools.com.cn/products/activereports_overview.htm
了解报表服务器:http://www.grapecity.com.cn/enterprise-solutions/activereports_server/
- ActiveReports 报表控件V12新特性 -- 新增JSON和CSV导出
- ActiveReports 报表控件V12新特性 -- 新增矩表的RepeatToFill属性
- ActiveReports 报表控件V12新特性 -- 文本框和标签控件的浓缩
- ActiveReports 报表控件V12新特性 -- RPX报表转换为RDL报表
- ActiveReports 报表控件发布全新 V12 版本,多项新特性增强设计能力
- ActiveReports 报表控件V12新特性 -- 无需ETL处理,即可实现跨数据源分析数据
- ActiveReports 报表控件V12新特性 -- 可定制的安装设置
- ActiveReports 报表控件 : 导出 PDF、Word 和 Excel文件到客户端
- ActiveReports 报表控件 初体验
- ActiveReports 报表控件的安装
- ActiveReports 报表应用教程 (16)---报表导出
- ActiveReports 报表应用教程 (16)---报表导出
- ActiveReports 报表控件官方中文入门教程 (3)-如何选择页面报表和区域报表
- php导出csv报表
- 葡萄城发布新版ActiveReports 9报表控件和报表服务器
- iOS9新增关键字和一些新特性
- ActiveReports 7.0报表控件版本比较
- HTML5新特性1(新表单控件/选择器/JSON/data)
- kdj python
- Lintcode178 Graph Valid Tree solution 题解
- 计算中英文混合字符串长度,中文算两个字符
- FreeBASIC学习笔记——8.1 指针的概念
- 帆软 取某个数据集的某个字段
- ActiveReports 报表控件V12新特性 -- 新增JSON和CSV导出
- 图论-拓扑排序(学习数据结构与算法分析 C++第三版—clifford A.Shaffer著)有感
- android textView识别html标签
- bzoj2879 [Noi2012]美食节(动态加边费用流)
- Java进阶之路——从初级程序员到架构师,从小工到专家
- Maven的相关问题处理(ClassNotFoundException/NoClassDefFoundError)
- LR12脚本回放时显示图片窗口
- 分布式环境搭建redhat7+hadoop2.6.1+jdk1.8
- C++ void*用法记录