Exemple #1
0
 /// <summary>
 /// 设置页脚样式
 /// </summary>
 /// <param name="table">表格</param>
 /// <param name="style">单元格样式</param>
 public IExcel FootStyle(PoJun.Util.Offices.Core.Table table, CellStyle style)
 {
     if (_footStyle == null)
     {
         _footStyle = CellStyleResolver.Resolve(_workbook, style);
     }
     Style(table.HeadRowCount + table.BodyRowCount, table.Count - 1, 0, table.ColumnNumber - 1, _footStyle);
     return(this);
 }
Exemple #2
0
 /// <summary>
 /// 设置正文样式
 /// </summary>
 /// <param name="table">表格</param>
 /// <param name="style">单元格样式</param>
 public IExcel BodyStyle(Table table, CellStyle style)
 {
     if (_bodyStyle == null)
     {
         _bodyStyle = CellStyleResolver.Resolve(_workbook, style);
     }
     Style(table.HeadRowCount, table.HeadRowCount + table.BodyRowCount - 1, 0, table.ColumnNumber - 1, _bodyStyle);
     return(this);
 }
Exemple #3
0
 /// <summary>
 /// 设置表头样式
 /// </summary>
 /// <param name="table">表格</param>
 /// <param name="style">单元格样式</param>
 public IExcel HeadStyle(Table table, CellStyle style)
 {
     if (_headStyle == null)
     {
         _headStyle = CellStyleResolver.Resolve(_workbook, style);
     }
     Style(0, table.HeadRowCount - 1, 0, table.ColumnNumber - 1, _headStyle);
     return(this);
 }
Exemple #4
0
        /// <summary>
        /// 创建日期样式
        /// </summary>
        private ICellStyle CreateDateStyle()
        {
            if (_dateStyle != null)
            {
                return(_dateStyle);
            }
            _dateStyle = CellStyleResolver.Resolve(_workbook, CellStyle.Body());
            var format = _workbook.CreateDataFormat();

            _dateStyle.DataFormat = format.GetFormat(_dateFormat);
            return(_dateStyle);
        }