Ejemplo n.º 1
0
        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;
        }
Ejemplo n.º 2
0
 public ExcelCell(IXLCell cell, ExcelStyle style)
 {
     this.Style = style;
     this.Cell  = cell;
 }
Ejemplo n.º 3
0
 public TableHeaderComponent()
 {
     Style = new ExcelStyle();
 }
Ejemplo n.º 4
0
 public void AddHeaderRight(string text, ExcelStyle style)
 {
     this.setting.Header.HeaderRight.Add(new TextComponent {
         Text = text, Style = style
     });
 }