Class XlsxColumnDate

All Implemented Interfaces:
Serializable, Identified

@Component public class XlsxColumnDate extends XlsxColumn
This class extends XlsxColumn.
The class implements and represent the column Date of an Excel sheet.
See Also:
  • Field Details

  • Constructor Details

    • XlsxColumnDate

      public XlsxColumnDate()
  • Method Details

    • setFORMAT

      public void setFORMAT(String s)
      Description copied from class: XlsxComponent
      Sets the number type format of the cell.
      Overrides:
      setFORMAT in class XlsxComponent
      Parameters:
      s - Allow format are:
      • '%' - Percent float format.
      • 'i' - Integer format.
      • 'f' - Float format.
      • 'e' - Accounting red float format.
      • default - Account float format.
    • setCELLFORMAT

      public void setCELLFORMAT(String s)
    • setRANGE

      public void setRANGE(String s)
      Define the range of the date, a "from" range or a "to" range.
      Parameters:
      s - The range to set, the possible values are "FROM" and "TO".
    • setDATEFORMAT

      public void setDATEFORMAT(String s)
      Sets if the XlsxColumnDate is represent as a real Date format into the excel sheet or not.
      If this attribute it's set to true or '1', the column's XSSFCellStyle will be set as Date into the sheet and also their values will be set as Date object.
      In this way the excel sheet will treat the data in the cells, from the column, as dates and no longer as text strings (for example in the definition of a filter on the column).
      Parameters:
      s - A string that represents a boolean value ("true" or "1", "false" or "0").
    • hasDateFormat

      public boolean hasDateFormat()
      Gets if the XlsxColumnDate is represent as a real Date format into the excel sheet or not.
      Returns:
      true or "1", false or "0".
      If this columns has a date format, its XSSFCellStyle will be set as Date into the sheet and also their values will be set as Date object.
      In this way the excel sheet will treat the data in the cells, from the column, as dates and no longer as text strings (for example in the definition of a filter on the column).
    • giveCell

      protected org.apache.poi.ss.usermodel.Cell giveCell(org.apache.poi.ss.usermodel.Sheet sheet, ArrayList row, int rowNum, int colNum, org.apache.poi.xssf.usermodel.XSSFCellStyle cs)
      Description copied from class: XlsxCell
      Method to implement that allows to set the orientation, the font etc
      Overrides:
      giveCell in class XlsxColumn
      Parameters:
      sheet - The sheet
      row - The list of rows
      rowNum - The number of row
      colNum - The cell number
      cs - The XSSFCellStyle
      Returns:
      The cell
    • setHOURSFORMAT

      public void setHOURSFORMAT(int hoursFormat)
      Sets the hour format of the column.
      By default the set value is the "12 hours format" e.g. 10PM or 10AM.
      Parameters:
      hoursFormat - The format to use for the column. For Example, using the Calendar class, possible value are "Calendar.HOUR" or "Calendar.HOUR_OF_DAY".
    • getHOURSFORMAT

      public int getHOURSFORMAT()
      Gets the hour format of the column.
      By default the get value is the "12 hours format" e.g.10PM or 10AM.
      Returns:
      The hour format of the column.