日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 前端技术 > javascript >内容正文

javascript

ActiveReports 报表控件V12新特性 -- 新增JSON和CSV导出

發布時間:2023/11/29 javascript 31 豆豆
生活随笔 收集整理的這篇文章主要介紹了 ActiveReports 报表控件V12新特性 -- 新增JSON和CSV导出 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
ActiveReports 報表控件V12新特性 -- 新增JSON和CSV導出

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 = new GrapeCity.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 = new GrapeCity.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 = new GrapeCity.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 = new GrapeCity.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/

posted on 2017-12-18 15:25 春筍拔節 閱讀(...) 評論(...) 編輯 收藏

轉載于:https://www.cnblogs.com/chunsunbajie/p/json_csv.html

總結

以上是生活随笔為你收集整理的ActiveReports 报表控件V12新特性 -- 新增JSON和CSV导出的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。