Class XlsxTableView

All Implemented Interfaces:
Serializable, XlsxElement, Identified
Direct Known Subclasses:
XlsxDBStatementView

@Component public class XlsxTableView extends XlsxContainer implements XlsxElement, Identified
This class extends XlsxContainer and implements Identified and implements XlsxElement.
This class represent an Excel working sheet as a table which is. There can be more working sheets, in that case they must have different name and label, the title is optional.
It manages to representa DBView in an Excel sheet.
See Also:
  • Field Details

    • _name

      protected String _name
    • _dbv

      protected DBView _dbv
    • _lastRow

      protected int _lastRow
    • _lastCol

      protected int _lastCol
    • _startRow

      protected int _startRow
    • _startCol

      protected int _startCol
    • _defaultStartRow

      protected int _defaultStartRow
    • _vAutoSize

      protected boolean _vAutoSize
    • _titleFontSize

      protected int _titleFontSize
    • _titleFont

      protected String _titleFont
    • _charSpan

      protected int _charSpan
    • _columnSize

      protected int[] _columnSize
    • _enabledChild

      protected ArrayList _enabledChild
    • _showTitles

      protected boolean _showTitles
    • _boldTitles

      protected boolean _boldTitles
    • _haveTotal

      protected Boolean _haveTotal
    • _titleWrap

      protected boolean _titleWrap
    • _autoSize

      protected boolean _autoSize
    • _customSize

      protected boolean _customSize
    • _rowHeight

      protected int _rowHeight
    • _lines4Row

      protected int _lines4Row
    • _forcedLines4Row

      protected boolean _forcedLines4Row
    • _breakColumns

      protected String[] _breakColumns
    • _breakColumnsPos

      protected int[] _breakColumnsPos
  • Constructor Details

    • XlsxTableView

      public XlsxTableView()
  • Method Details

    • getIdentity

      public Identity getIdentity()
      Description copied from interface: Identified
      Returns the Identity associated to the component
      Specified by:
      getIdentity in interface Identified
      Overrides:
      getIdentity in class XlsxComponent
      Returns:
      The Identity of the user currently logged in the application
    • setIdentity

      public void setIdentity(Identity identity)
      Description copied from interface: Identified
      Sets the Identity to the component
      Specified by:
      setIdentity in interface Identified
      Overrides:
      setIdentity in class XlsxComponent
      Parameters:
      identity - The Identity that must be associated to the component
    • setHEADTITLES

      public void setHEADTITLES(String s)
      Sets the head title of the table.
      Parameters:
      s - The title to set.
    • getHeadTitles

      public boolean getHeadTitles()
      Gets the head title of the table.
      Returns:
      The head title of the table.
    • setBOLDTITLES

      public void setBOLDTITLES(String s)
      Sets if you want title with the bold format or not.
      Parameters:
      s - 'true' or '1' if you want to add bold format to the title, 'false' or '0' otherwise.
    • hasBoldTitles

      public boolean hasBoldTitles()
      Gets if the title has the bold format.
      Returns:
      true if title has the bold format, false otherwise.
    • setHEADERFONTCOLOR

      public void setHEADERFONTCOLOR(String s)
      Sets the font colore on the header's text.
      Parameters:
      s - The color to set.
    • getHeaderFontColor

      public org.apache.poi.xssf.usermodel.XSSFColor getHeaderFontColor()
      Gets the header font color in use.
      Returns:
      The header font XSSFColor.
    • setROWHEIGHT

      public void setROWHEIGHT(String h)
      Sets the height of the rows.
      Parameters:
      h - The height to set.
    • getRowHeight

      public int getRowHeight()
      Gets the height of the rows.
      Returns:
      The height of the rows.
    • setLINES4ROW

      public void setLINES4ROW(String l)
      Sets the number of lines per rows.
      Parameters:
      l - The number line to set.
    • getLines4Row

      public int getLines4Row()
      Gets the number of liner per row.
      Returns:
      The number of liner per row.
    • setAUTOSIZE

      public void setAUTOSIZE(String s)
      Sets if Table must have horizontal autoSize enabled or not.
      Parameters:
      s - 'true' or '1' if the horizontal autosize must be enabled, 'false' or '0' otherwise.
    • setCUSTOMSIZE

      public void setCUSTOMSIZE(String s)
      Sets if Table must have a custom size or not.
      Parameters:
      s - 'true' or '1' if the table allows custom size, 'false' or '0' otherwise.
    • setSTARTCOL

      public void setSTARTCOL(String s)
      Sets the start column of the table.
      Parameters:
      s - The column to set.
    • setStartCol

      public void setStartCol(int col)
    • getDeafultStartRow

      public int getDeafultStartRow()
      Sets the default start row.
      Returns:
      The default start row.
    • setTITLEWRAP

      public void setTITLEWRAP(String s)
      Sets if you want to wrap the sheet's title or not.
      Parameters:
      s - "1" if you want to wrap the title, "0" otherwise.
    • getTitleWrap

      public boolean getTitleWrap()
      Gets if the sheet's title is wrapped or not.
      Returns:
      true if the title is wrapped,false otherwise.
    • setTITLEFONTSIZE

      public void setTITLEFONTSIZE(String s)
      Sets the font size of the title.
      Parameters:
      s - The size to set.
    • getTitleFontSize

      public int getTitleFontSize()
      Gets the font size use on the title's text.
      Returns:
      The font size used.
    • setTITLEFONT

      public void setTITLEFONT(String s)
      Sets the title's font.
      Parameters:
      s - The font to set.
    • getTitleFont

      public String getTitleFont()
      Gets the title's font.
      Returns:
      The title's font.
    • setVAUTOSIZE

      public void setVAUTOSIZE(String s)
      Sets if Table must have vertical autoSize enabled or not.
      Parameters:
      s - 'true' or '1' if the vertical autosize must be enabled, 'false' or '0' otherwise.
    • setCHARSPAN

      public void setCHARSPAN(String s)
      Sets the char span of a row.
      Parameters:
      s - The span to set
    • getCharSpan

      public int getCharSpan()
      Gets the char span of a row.
      Returns:
      The char span of a row.
    • setSTARTROW

      public void setSTARTROW(String s)
      Sets the start row.
      Parameters:
      s - The start row to set.
    • setStartRow

      public void setStartRow(int row)
      Sets the start row.
      Parameters:
      row - The start row to set.
    • setBREAKCOLUMNS

      public void setBREAKCOLUMNS(String s)
      Define the break columns.
      Parameters:
      s - The String with the list of the break columns separated by comma.
    • setNAME

      public void setNAME(String s)
      Description copied from class: XlsxComponent
      Sets the name for the instance.
      Overrides:
      setNAME in class XlsxComponent
      Parameters:
      s - The name to set.
    • getName

      public String getName()
      Description copied from class: XlsxComponent
      Gets the name of tbe instance.
      Specified by:
      getName in interface XlsxElement
      Overrides:
      getName in class XlsxComponent
      Returns:
      The name of the instance.
    • getStartRow

      public int getStartRow()
      Gets the start row.
      Returns:
      The start row.
    • getStartCol

      public int getStartCol()
      Gets the start column.
      Returns:
      The start column.
    • getContent

      public void getContent(org.apache.poi.ss.usermodel.Sheet sheet, int startRow, int startCol) throws Exception
      Specified by:
      getContent in interface XlsxElement
      Throws:
      Exception
    • setDataView

      public void setDataView(Object dbview)
      Sets the DataView into the active sheet.
      Parameters:
      dbview - The DataView to set.
    • getDataView

      public DBView getDataView()
      Gets the Data View of the sheet.
      Returns:
      The DBView with the Data View of the sheet.
    • haveTotal

      public boolean haveTotal()
      Gets if the table has the column or the row (or both) that represent totals values, or not.
      Returns:
      true if the table has the total end column or row, false otherwise.
    • getEnabledChild

      protected ArrayList getEnabledChild()
    • initChilds

      public void initChilds(DBView dbv)
    • addTestata

      protected void addTestata(org.apache.poi.ss.usermodel.Sheet sheet, int row)
    • addCells

      protected int addCells(int startRow, int startCol, DBView dbv, org.apache.poi.ss.usermodel.Sheet sheet) throws Exception
      Throws:
      Exception
    • addCells

      protected int addCells(int startRow, int startCol, DBView dbv, org.apache.poi.ss.usermodel.Sheet sheet, boolean append) throws Exception
      Throws:
      Exception
    • setColumnSizing

      protected void setColumnSizing(org.apache.poi.ss.usermodel.Sheet sheet, int posCell)
    • addTotali

      protected void addTotali(int startRow, int endRow, org.apache.poi.ss.usermodel.Sheet sheet)
    • autoSize

      protected void autoSize(org.apache.poi.ss.usermodel.Sheet sheet)
    • customSize

      protected void customSize(org.apache.poi.ss.usermodel.Sheet sheet)
    • getOccupationCol

      public int getOccupationCol()
      Specified by:
      getOccupationCol in interface XlsxElement
    • getOccupationRow

      public int getOccupationRow()
      Specified by:
      getOccupationRow in interface XlsxElement
    • addBreakFunctions

      protected void addBreakFunctions(ArrayList ar, Object[] fields, org.apache.poi.ss.usermodel.Sheet sheet, int breakRow, int row, int col, int breakFieldPos)
    • addNewColumn

      public XlsxColumn addNewColumn(String columnType, XlsxDocument xlsDoc)
      Add a new column type (passed by parameter) as child of this instance.
      Parameters:
      columnType - The type of the new column
      xlsDoc - The doc from which retrieve the schema for the column
      Returns:
      a new XlsxColumn type (passed by parameter) as child of this instance.
    • getXlsxColumnPosByName

      public String getXlsxColumnPosByName(String s)
      Gets the column's position, from his name.
      Parameters:
      s - The name of the column to retrieve
      Returns:
      The column's position.