src/Bro.M071.DBManager/ExcelExportHelper.cs
@@ -107,7 +107,7 @@ { // autofit width of cells with small content ExcelRange columnCells = workSheet.Cells[workSheet.Dimension.Start.Row, columnIndex, workSheet.Dimension.End.Row, columnIndex]; int maxLength = columnCells.Max(cell => cell.Value.ToString().Count()); int maxLength = columnCells.Max(cell => (cell.Value ?? "").ToString().Count()); if (maxLength < 150) { workSheet.Column(columnIndex).AutoFit(); @@ -258,7 +258,7 @@ { try { return obj.ToString(); return (obj ?? "").ToString(); } catch (Exception) {