ExportExcelCellStyle.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. using NPOI.SS.UserModel;
  2. namespace YBEE.EQM.Application;
  3. /// <summary>
  4. /// 导出单元格样式
  5. /// </summary>
  6. public class ExportExcelCellStyle
  7. {
  8. /// <summary>
  9. /// 标题字段
  10. /// </summary>
  11. public string TitleFontName { get; set; } = "黑体";
  12. /// <summary>
  13. /// 常规字段
  14. /// </summary>
  15. public string FontName { get; set; } = "宋体";
  16. /// <summary>
  17. /// 标题样式
  18. /// </summary>
  19. public ICellStyle TitleStyle { get; set; }
  20. /// <summary>
  21. /// 摘要样式
  22. /// </summary>
  23. public ICellStyle SummaryStyle { get; set; }
  24. /// <summary>
  25. /// 列头样式
  26. /// </summary>
  27. public ICellStyle ColumnHeaderStyle { get; set; }
  28. /// <summary>
  29. /// 居中对齐
  30. /// </summary>
  31. public ICellStyle CenterCellStyle { get; set; }
  32. /// <summary>
  33. /// 居左对齐
  34. /// </summary>
  35. public ICellStyle LeftCellStyle { get; set; }
  36. /// <summary>
  37. /// 居右对齐
  38. /// </summary>
  39. public ICellStyle RightCellStyle { get; set; }
  40. /// <summary>
  41. /// 填充样式
  42. /// </summary>
  43. public ICellStyle FillCellStyle { get; set; }
  44. /// <summary>
  45. /// 默认标题高度
  46. /// </summary>
  47. public static readonly short DefaultTitleHeight = 50 * 20;
  48. /// <summary>
  49. /// 默认行高
  50. /// </summary>
  51. public static readonly short DefaultRowHeight = 20 * 20;
  52. }