新增加Excel导出单元格自适应
This commit is contained in:
parent
f6c2569559
commit
67c6402dc9
@ -125,7 +125,8 @@ namespace ZR.Admin.WebApi.Controllers
|
||||
{
|
||||
// 添加worksheet
|
||||
ExcelWorksheet worksheet = package.Workbook.Worksheets.Add(sheetName);
|
||||
|
||||
//单元格自动适应大小
|
||||
worksheet.Cells.Style.ShrinkToFit = true;
|
||||
//全部字段导出
|
||||
worksheet.Cells.LoadFromCollection(list, true, OfficeOpenXml.Table.TableStyles.Light13);
|
||||
package.Save();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user