12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- using NPOI.SS.UserModel;
- namespace YBEE.EQM.Application;
- /// <summary>
- /// 导出 Excel 定义
- /// </summary>
- public class ExportExcelDto<T>
- {
- /// <summary>
- /// 是否XLSX格式
- /// </summary>
- public bool IsXlsx { get; set; } = true;
- /// <summary>
- /// 工作表名称
- /// </summary>
- public string SheetName { get; set; } = "Sheet1";
- /// <summary>
- /// 文件名
- /// </summary>
- public string FileName { get; set; }
- /// <summary>
- /// 标题
- /// </summary>
- public string Title { get; set; }
- /// <summary>
- /// 标题高度
- /// </summary>
- public short? TitleHeight { get; set; }
- /// <summary>
- /// 行高
- /// </summary>
- public short? RowHeight { get; set; }
- /// <summary>
- /// 列头高度
- /// </summary>
- public short? ColumnHeaderHeight { get; set; }
- /// <summary>
- /// 包含导出时间
- /// </summary>
- public bool IncludeExportTime { get; set; } = true;
- /// <summary>
- /// 摘要
- /// </summary>
- public string Summary { get; set; } = "";
- /// <summary>
- /// 列定义
- /// </summary>
- public List<ExportExcelColDto<T>> Columns { get; set; }
- /// <summary>
- /// 数据行
- /// </summary>
- public List<T> Items { get; set; }
- /// <summary>
- /// 自定义概要
- /// </summary>
- public Func<ISheet, ExportExcelCellStyle, int, int> BuildSummary { get; set; }
- /// <summary>
- /// 设置Sheet属性
- /// </summary>
- public Action<ISheet> SetSheet { get; set; }
- /// <summary>
- /// 字体大小
- /// </summary>
- public double FontSize { get; set; } = 10;
- /// <summary>
- /// 标题字体大小
- /// </summary>
- public double TitleFontSize { get; set; } = 16;
- /// <summary>
- /// 表头行高
- /// </summary>
- public short HeaderHeight { get; set; } = ExportExcelCellStyle.DefaultRowHeight;
- }
|