JanKallman / EPPlus

Create advanced Excel spreadsheets using .NET
3.76k stars 1.18k forks source link

Bug: exception in EPPlus during ExcelRangeBase.AutoFitColumns() #396

Open dsandoul opened 5 years ago

dsandoul commented 5 years ago

We have got an exception for large reports (about 60 days) trying to auto fit columns:

using (var cells = sheet.Cells[sheet.Dimension.Address]) { ... cells.AutoFitColumns();

My Error:

Exception in ProcessAndEmailReportSync(): System.ArgumentOutOfRangeException: Ticks must be between DateTime.MinValue.Ticks and DateTime.MaxValue.Ticks. Parameter name: ticks в System.DateTime..ctor(Int64 ticks) в OfficeOpenXml.ExcelRangeBase.FormatValue(Object v, ExcelFormatTranslator nf, String format, String textFormat) в OfficeOpenXml.ExcelRangeBase.AutoFitColumns(Double MinimumWidth, Double MaximumWidth) в OfficeOpenXml.ExcelRangeBase.AutoFitColumns()

Sorry, I can not debug and supply report with real report data because it is rare exception and reproduces only on customer's network. All we can is just catch the exception.

EPPlus.4.5.3

Can we hope the fix will appear sometime?

WBR, Dmitry

shuxinqin commented 5 years ago

We also met this exception on linux. EPPlus version: 4.5.2.1