public ExportExcelPageMaker(ExcelContentFormat header, ExcelContentFormat content) { TkDebug.AssertArgumentNull(header, "header", null); TkDebug.AssertArgumentNull(content, "content", null); Header = header; Content = content; }
public void OnReadObject() { if (Header == null) { Header = ExcelContentFormat.DefaultHead; } if (Content == null) { Content = ExcelContentFormat.DefaultContent; } }
// 字体设置 private static IFont FontSetting(IWorkbook workbook, ExcelContentFormat excelFormat) { IFont fontContent = workbook.CreateFont(); if (!string.IsNullOrEmpty(excelFormat.FontName)) { fontContent.FontName = excelFormat.FontName; } if (excelFormat.FontBold) { fontContent.Boldweight = (short)FontBoldWeight.Bold; } if (excelFormat.FontSize > 0) { fontContent.FontHeightInPoints = excelFormat.FontSize; } return(fontContent); }
// 字体设置 private static IFont FontSetting(IWorkbook workbook, ExcelContentFormat excelFormat) { IFont fontContent = workbook.CreateFont(); if (!string.IsNullOrEmpty(excelFormat.FontName)) fontContent.FontName = excelFormat.FontName; if (excelFormat.FontBold) fontContent.Boldweight = (short)FontBoldWeight.Bold; if (excelFormat.FontSize > 0) fontContent.FontHeightInPoints = excelFormat.FontSize; return fontContent; }