NPOI 導出excel時,使用AutoSizeColumn報如下錯誤:
System.ArgumentException: Parameter is not valid. at System.Drawing.Bitmap..ctor(Int32 width, Int32 height, PixelFormat format) at System.Drawing.Bitmap..ctor(Int32 width, Int32 height) at NPOI.SS.Util.SheetUtil.GetCellWidth(ICell cell, Int32 defaultCharWidth, DataFormatter formatter, Boolean useMergedCells) at NPOI.SS.Util.SheetUtil.GetColumnWidth(ISheet sheet, Int32 column, Boolean useMergedCells) at NPOI.HSSF.UserModel.HSSFSheet.AutoSizeColumn(Int32 column, Boolean useMergedCells)
解決辦法:
將npoi的版本從2.1.3.1更換成 2.2.1.0,問題解決。
參考鏈接:https://stackoverflow.com/questions/19873803/npoi-auto-resize-column |