Class SheetConfiguration


  • public class SheetConfiguration
    extends Object
    Encapsulates the configurable attributes for an XLSX export
    • Constructor Detail

      • SheetConfiguration

        public SheetConfiguration()
      • SheetConfiguration

        public SheetConfiguration​(ReportDetails reportDetails,
                                  float fontSize)
        initializes the sheet configuration
        Parameters:
        reportDetails - ReportDetails class object that contains all the needed information to export a result set from barista to pdf
        fontSize - the sheet configuration's font size
    • Method Detail

      • addColumn

        public void addColumn​(String header)
                       throws Exception
        Appends a new column to the back of the list of columns
        Parameters:
        header - : label of the new column to be added
        Throws:
        Exception - in case any parameter found invalid
      • addColumn

        public void addColumn​(String header,
                              int width)
                       throws Exception
        Appends a new column to the back of the list of columns
        Parameters:
        header - : label of the new column to be added
        width - : width of the new column in number of characters
        Throws:
        Exception - in case any parameter found invalid
      • addColumn

        public void addColumn​(String header,
                              ColumnConfigurationBuilder colConfigBuilder)
                       throws Exception
        Appends a new column to the back of the list of columns
        Parameters:
        header - : label of the new column to be added
        colConfigBuilder - : ColumnConfigurationBuilder object containing column customizations
        Throws:
        Exception - in case any parameter found invalid
      • insertColumn

        public void insertColumn​(String header,
                                 int index)
                          throws Exception
        Inserts a new column in position to the list of columns
        Parameters:
        header - : label of the new column to be added
        index - : position of the new column with 0-based indexing
        Throws:
        Exception - in case any parameter found invalid
      • insertColumn

        public void insertColumn​(String header,
                                 int width,
                                 int index)
                          throws Exception
        Inserts a new column in position to the list of columns
        Parameters:
        header - : label of the new column to be added
        index - : position of the new column with 0-based indexing
        width - : width of the new column in number of characters
        Throws:
        Exception - in case any parameter found invalid
      • insertColumn

        public void insertColumn​(String header,
                                 ColumnConfigurationBuilder colConfigBuilder,
                                 int index)
                          throws Exception
        Inserts a new column in position to the list of columns
        Parameters:
        header - : label of the new column to be added
        colConfigBuilder - : ColumnConfigurationBuilder object containing column customizations
        index - : position of the new column with 0-based indexing
        Throws:
        Exception - in case of invalid index or any parameter found invalid
      • removeColumn

        public void removeColumn​(int index)
                          throws IndexOutOfBoundsException
        Removes the column at the given position
        Parameters:
        index - : position of the new column with 0-based indexing
        Throws:
        IndexOutOfBoundsException - in case of invalid index
      • clearColumns

        public void clearColumns()
        Removes all columns
      • getColumnNamesOrdered

        public List<String> getColumnNamesOrdered()
        Gets the list of column names maintaining intended order
        Returns:
        List of String containing column names
      • getConfiguredSheet

        public org.apache.poi.ss.usermodel.Sheet getConfiguredSheet​(org.apache.poi.ss.usermodel.Sheet sheet)
        Applies configurations to sheet
        Parameters:
        sheet - : provided Sheet object to configure
        Returns:
        configured Sheet object
      • getSheetName

        public String getSheetName()
        returns the sheet name configured for excel sheets
        Returns:
        sheet name
      • setSheetName

        public void setSheetName​(String sheetName)
        sets the Sheet Name for Excel Sheet Pages
        Parameters:
        sheetName - : the name
      • getColumnConfigurations

        public List<ColumnConfiguration> getColumnConfigurations()
        Gets the column configuration
        Returns:
        returns the column configuration
      • insertColumn

        public void insertColumn​(String header,
                                 int width,
                                 String fieldName,
                                 int index)
                          throws Exception
        Creates a new column and inserts it into given position abstracted away from exposed methods
        Parameters:
        header - label of the new column to be added
        width - the column width
        fieldName - the column's field name
        index - position of the new column with 0-based indexing
        Throws:
        Exception - in case of invalid index or any parameter found invalid
      • addColumn

        public void addColumn​(String header,
                              int width,
                              String fieldName)
                       throws Exception
        Appends a new column to the back of the list of columns
        Parameters:
        header - label of the new column to be added
        width - the column width
        fieldName - the column's field name
        Throws:
        Exception - in case of invalid index or any parameter found invalid
      • setReportDetails

        public void setReportDetails​(ReportDetails reportDetails)
        Sets the report details
        Parameters:
        reportDetails - the report details class object
      • getReportDetails

        public ReportDetails getReportDetails()
        Gets the report details
        Returns:
        returns the report details
      • setFontSize

        public void setFontSize​(float fontSize)
        Sets the font size
        Parameters:
        fontSize - the font size
      • getFontSize

        public float getFontSize()
        Gets the font size
        Returns:
        returns the font size