/// <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(); }
/// <summary> /// 初始化导出 /// </summary> /// <param name="format">导出格式</param> protected ExportBase(ExportFormat format) { Table = new Table(); _format = format; _headStyle = CellStyle.Head(); _bodyStyle = CellStyle.Body(); _footStyle = CellStyle.Foot(); }
/// <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); }