protected override void SetStyle() { WorksheetConfig setting = new WorksheetConfig(); //set page setting.Content.BorderStyle = XLBorderStyleValues.Thin; setting.ShowGridLine = false; setting.Content.WrapText = false; setting.TableHeader.Style.Bold = false; setting.PageSetup.PageOrientation = XLPageOrientation.Landscape; setting.PageSetup.PaperSize = XLPaperSize.A4Paper; //set style base styleBase = new ExcelStyle(); styleBase.Horizontal = XLAlignmentHorizontalValues.Center; styleBase.Bold = true; //styleheader styleheader = styleBase.Clone(); styleheader.Bold = false; //style title styletitle = styleBase.Clone(); styletitle.Horizontal = XLAlignmentHorizontalValues.Center; styletitle.FontSize = 18; styletitle.FontColor = Color.Blue; //style table header styleTableheader = styleBase.Clone(); styleTableheader.Horizontal = XLAlignmentHorizontalValues.Left; styleTableheader.Bold = true; setting.TableHeader.Style = styleTableheader; //style sub title stylesubtitle = styleBase.Clone(); stylesubtitle.Horizontal = XLAlignmentHorizontalValues.Center; stylesubtitle.Bold = false; stylesubtitle.FontSize = 10; stylesubtitle.Italic = true; setting.Title.SubTitle.Style = stylesubtitle; setting.Title.Title.Style = styletitle; this.setting = setting; }
public ExcelCell(IXLCell cell, ExcelStyle style) { this.Style = style; this.Cell = cell; }
public TableHeaderComponent() { Style = new ExcelStyle(); }
public void AddHeaderRight(string text, ExcelStyle style) { this.setting.Header.HeaderRight.Add(new TextComponent { Text = text, Style = style }); }