diff --git a/Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application/AppBase/ZbxBase.cs b/Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application/AppBase/ZbxBase.cs index 886dbde..ebe5e9d 100644 --- a/Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application/AppBase/ZbxBase.cs +++ b/Code/Be/Faster.Zheng.Winin/src/Faster.Zheng.Winin.Application/AppBase/ZbxBase.cs @@ -285,7 +285,10 @@ public class ZbxBase p.Name == "Details"); - //从表 + // 子表 var detailList = (IEnumerable)mainAllProperties[detailsIndex].GetValue(mainDto); var startMainRowIndex = rowIndex; for (var datailCount = 0; datailCount < detailList.Count(); datailCount++) @@ -407,13 +412,17 @@ public class ZbxBase /// /// - private static ICellStyle SetExcelDetailsColor(IWorkbook workbook) + private static ICellStyle SetExcelDetailsCellStyle(IWorkbook workbook) + { + var cellStyle = workbook.CreateCellStyle(); + cellStyle.FillBackgroundColor = IndexedColors.Grey25Percent.Index; + cellStyle.FillForegroundColor = IndexedColors.Grey25Percent.Index; + cellStyle.FillPattern = FillPattern.SolidForeground; + return cellStyle; + } + + /// + /// 导出设置只有主表时的交替行 单元格样式 + /// + /// + /// + private static ICellStyle SetExcelOnlyMainCellStyle(IWorkbook workbook) + { + var cellStyle = workbook.CreateCellStyle(); + cellStyle.FillBackgroundColor = IndexedColors.Grey25Percent.Index; + cellStyle.FillForegroundColor = IndexedColors.Grey25Percent.Index; + cellStyle.FillPattern = FillPattern.SolidForeground; + return cellStyle; + } + + /// + /// 设置分割单元格的演示 + /// + /// + /// + private static ICellStyle SetSplitCellStyle(IWorkbook workbook) + { + var cellStyle = workbook.CreateCellStyle(); + cellStyle.BorderLeft = BorderStyle.MediumDashed; + cellStyle.BorderRight = BorderStyle.MediumDashed; + cellStyle.LeftBorderColor = IndexedColors.BrightGreen.Index; + cellStyle.RightBorderColor = IndexedColors.Grey25Percent.Index; + cellStyle.FillBackgroundColor = IndexedColors.White.Index; + cellStyle.FillForegroundColor = IndexedColors.White.Index; + cellStyle.FillPattern = FillPattern.ThickVerticalBands; + return cellStyle; + } + + /// + /// 导出设置表头单元格样式 + /// + /// + /// + private static ICellStyle SetExcelHeadCellStyle(IWorkbook workbook) { var cellStyle = workbook.CreateCellStyle(); cellStyle.FillBackgroundColor = IndexedColors.LightOrange.Index;