public void SetWidth(TgColumnBase tgColumn) { var sheetColumn = _worksheet.Column(tgColumn.PositionInSheet); if (tgColumn.AutoWidth) { sheetColumn.AutoFit(); } else { if (tgColumn.Width <= 0) { if (_defaultColumnOptions.AutoWidth) { sheetColumn.AutoFit(); } else { if (_defaultColumnOptions.Width <= 0) { sheetColumn.AutoFit(); } else { sheetColumn.Width = _defaultColumnOptions.Width; } } } else { sheetColumn.Width = tgColumn.Width; } } }
public void SetStyle(TgColumnBase tgColumn, int rowsCount) { var sheetColumn = _worksheet .Cells[_row, tgColumn.PositionInSheet, _row + rowsCount, tgColumn.PositionInSheet]; sheetColumn.Style.SetStyle(tgColumn.Style ?? _defaultColumnOptions.Style); }
public void SetHeaderStyle(TgColumnBase tgColumn) { var cell = _worksheet.Cells[_row, tgColumn.PositionInSheet]; cell.Style.SetStyle(tgColumn.HeaderStyle ?? _defaultColumnOptions.HeaderStyle); }
public void SetHeaderText(TgColumnBase tgColumn) { var cell = _worksheet.Cells[_row, tgColumn.PositionInSheet]; cell.Value = tgColumn.Header; }