The maximum column width for an individual cell is 255 characters. 的解决方案

以后要多些博客!!!

解决方案:

//设置列宽
                           // sheet.SetColumnWidth(column.Ordinal, (arrColWidth[column.Ordinal] + 1) * 256);
                           if (arrColWidth[column.Ordinal] > 255)
                           {
                               arrColWidth[column.Ordinal] = 254;
                           }
                           else
                           {
                               sheet.SetColumnWidth(column.Ordinal, (arrColWidth[column.Ordinal] + 1) * 256);
                           }

你可能感兴趣的:(随笔记)