1234567891011121314151617181920212223242526272829303132333435363738 |
- using NPOI.SS.UserModel;
- namespace YBEE.EQM.Application;
- /// <summary>
- /// EXCEL导出服务
- /// </summary>
- public interface IExportExcelService
- {
- /// <summary>
- /// 导出 Excel 文件
- /// </summary>
- /// <typeparam name="T"></typeparam>
- /// <param name="input"></param>
- /// <returns></returns>
- byte[] ExportExcel<T>(ExportExcelDto<T> input);
- /// <summary>
- /// 获取单元格表头和单元格样式
- /// </summary>
- /// <param name="wb"></param>
- /// <param name="fontSize"></param>
- /// <param name="titleFontSize"></param>
- /// <returns></returns>
- ExportExcelCellStyle GetCellStyle(IWorkbook wb, double fontSize = 10, double titleFontSize = 16);
- /// <summary>
- /// 添加单元格
- /// </summary>
- /// <param name="value"></param>
- /// <param name="row"></param>
- /// <param name="columnIndex"></param>
- /// <param name="cellStyle"></param>
- /// <param name="sheet"></param>
- /// <param name="width"></param>
- void AddCell(object value, IRow row, int columnIndex, ICellStyle cellStyle, ISheet sheet = null, int? width = 8);
- }
|