Пример #1
0
 /// <summary>
 ///     New cell
 /// </summary>
 /// <param name="value"></param>
 /// <param name="rowspan"></param>
 /// <param name="colspan"></param>
 /// <param name="cellStyle"></param>
 /// <returns></returns>
 public ExcelFile Cell(DateTime value, int rowspan, int colspan, ExcelStyle cellStyle = null)
 {
     Cell(value, cellStyle);
     Merge(_row.RowNum, _cell.ColumnIndex, rowspan, colspan);
     Empty(colspan - 1);
     return(this);
 }
Пример #2
0
 /// <summary>
 ///     New row
 /// </summary>
 /// <param name="rowStyle"></param>
 /// <returns></returns>
 public ExcelFile Row(ExcelStyle rowStyle = null)
 {
     _row      = _sheet.CreateRow(_row?.RowNum + 1 ?? 0);
     _cell     = null;
     _rowStyle = rowStyle?.Style;
     return(this);
 }
Пример #3
0
 /// <summary>
 ///     New cell
 /// </summary>
 /// <param name="value"></param>
 /// <param name="cellStyle"></param>
 /// <returns></returns>
 public ExcelFile Cell(DateTime value, ExcelStyle cellStyle = null)
 {
     _cell = _row.CreateCell(_cell?.ColumnIndex + 1 ?? 0);
     _cell.SetCellValue(value);
     if (cellStyle != null)
     {
         _cell.CellStyle = cellStyle.Style;
     }
     else if (_rowStyle != null)
     {
         _cell.CellStyle = _rowStyle;
     }
     else
     {
         _cell.CellStyle = _cellStyle;
     }
     return(this);
 }
Пример #4
0
 /// <summary>
 ///     New row
 /// </summary>
 /// <param name="height"></param>
 /// <param name="rowStyle"></param>
 /// <returns></returns>
 public ExcelFile Row(short height, ExcelStyle rowStyle = null)
 {
     Row(rowStyle);
     _row.Height = (short)(height * 20);
     return(this);
 }