Exemplo n.º 1
0
 /// <summary>
 /// 初始化一个<see cref="ExportBase"/>类型的实例
 /// </summary>
 /// <param name="version">版本</param>
 protected ExportBase(ExcelVersion version)
 {
     Sheet      = new WorkSheet();
     _version   = version;
     _headStyle = CellStyle.Head();
     _bodyStyle = CellStyle.Body();
     _footStyle = CellStyle.Foot();
 }
Exemplo n.º 2
0
 /// <summary>
 /// 初始化导出
 /// </summary>
 /// <param name="format">导出格式</param>
 protected ExportBase(ExportFormat format)
 {
     Table      = new Table();
     _format    = format;
     _headStyle = CellStyle.Head();
     _bodyStyle = CellStyle.Body();
     _footStyle = CellStyle.Foot();
 }
Exemplo n.º 3
0
        /// <summary>
        /// 创建日期样式
        /// </summary>
        /// <returns></returns>
        private NPOI.SS.UserModel.ICellStyle CreateDateStyle()
        {
            if (_dateStyle != null)
            {
                return(_dateStyle);
            }
            _dateStyle = CellStyleResolver.Resolve(_workbook, CellStyle.Body());
            var format = _workbook.CreateDataFormat();

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