Auto column width in EPPlus

前端 未结 10 1355
心在旅途
心在旅途 2020-12-23 00:31

How to make columns to be auto width when texts in columns are long?

I use this code

 Worksheet.Column(colIndex).AutoFitColumn() \'on all columns\'
         


        
10条回答
  •  执笔经年
    2020-12-23 00:56

    The .NET Core as a successor of .NET doesn't support anymore the function autofit cells with EPPplus library.

    worksheet.Cells.AutoFitColumns();
    

    or

    worksheet.Column(1).AutoFit();
    

    causes exception:

    "System.Drawing is not supported on this platform."
    

    The System.Drawing assembly is dependent on GDI and Windows specific libraries which have to be replaced by another solution. The solution for this issue is to me unknown.

提交回复
热议问题