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

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

WeihanLi.Npoi 1.20.0 Released

發布時間:2023/12/4 编程问答 56 豆豆
生活随笔 收集整理的這篇文章主要介紹了 WeihanLi.Npoi 1.20.0 Released 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

WeihanLi.Npoi 1.20.0 Released

Intro

WeihanLi.Npoi 是一個基于 netstandard2.0 的一個 NPOI 擴展庫,主要用于導入導出 Excel 以及CSV,支持通過 Fluent API 的方式來支持非常靈活的導入導出配置,詳細使用可以參考文檔介紹以及項目示例

Updates

最近我自己沒什么更新,主要是一個外國小哥提了三個 PR,主要改進了 Excel 文件導入成一個 DataTable,對應的 API 是 ExcelHelper.ToDataTable

最近針對 DataTable 的改進都是基于導入一個別的地方生成的一個 excel 文件,如果你是 DataTable 使用這個庫導出的話再導入是不會有問題的,主要更新如下:

Bug fix:

  • 修復導入的 Excel 文件表頭單元格格式不是 string 時數據處理異常的 BUG https://github.com/WeihanLi/WeihanLi.Npoi/pull/120

  • 修復導入的 Excel 文件存在空列時可能會導致數據不對的 BUG https://github.com/WeihanLi/WeihanLi.Npoi/pull/118

Features:

  • ExcelHelper.ToDataTable API 增加 bool removeEmptyRows = false, int? maxColumns = null 參數,支持移除空行和指定最大導入行數https://github.com/WeihanLi/WeihanLi.Npoi/pull/123

    DataTable?ToDataTable(byte[]?excelBytes,?ExcelFormat?excelFormat,?bool?removeEmptyRows?=?false,?int??maxColumns?=?default);DataTable?ToDataTable(byte[]?excelBytes,?ExcelFormat?excelFormat,?int?sheetIndex,?bool?removeEmptyRows?=?false,?int??maxColumns?=?default);DataTable?ToDataTable(string?excelPath,?int?sheetIndex,?int?headerRowIndex,?bool?removeEmptyRows?=?false,?int??maxColumns?=?default);
  • 作為對于 1.18.0 版本中引入的 MappingProfile feature 的改進(可以參考 WeihanLi.Npoi 1.18.0 Released),增加了幾個 API 來簡化 MappingProfiler 的注冊

    FluentSettings.LoadMappingProfile<TestEntity,?TestEntityExcelMappingProfile>();FluentSettings.LoadMappingProfile<TestEntityExcelMappingProfile>();FluentSettings.LoadMappingProfile(new?TestEntityExcelMappingProfile());

More

看提 PR 小哥的 Github 資料,是來自捷克共和國,布拉格的一位工程師

小哥非常認真,提交的每一個 PR 都對應提供了完善的單元測試用例,真的非常贊,為小哥點贊 :thumbsup:,感謝小哥的貢獻

我們如果在對開源項目做貢獻的時候,應該向這位小哥學習,也應該盡可能地在修復 BUG 或者貢獻新功能的同時提供對應的測試用例以構建更為健壯和高質量的開源項目

References

  • https://github.com/WeihanLi/WeihanLi.Npoi

  • https://weihanli.github.io/WeihanLi.Npoi/index.html

  • https://weihanli.github.io/WeihanLi.Npoi/docs/articles/intro.html

  • https://github.com/WeihanLi/WeihanLi.Npoi/pull/118

  • https://github.com/WeihanLi/WeihanLi.Npoi/pull/120

  • https://github.com/WeihanLi/WeihanLi.Npoi/pull/123

  • WeihanLi.Npoi 1.18.0 Released

總結

以上是生活随笔為你收集整理的WeihanLi.Npoi 1.20.0 Released的全部內容,希望文章能夠幫你解決所遇到的問題。

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