Class AbstractExcelExporter

    • Field Detail

      • workbook

        protected Workbook workbook
        Exporting destination, POI book model
      • sbook

        protected SBook sbook
      • styleTable

        protected Map<SCellStyle,​CellStyle> styleTable
        The map stores the exported CellStyle during exporting, so that we can reuse them for exporting other cells.
      • _exportPhase

        protected io.keikai.range.impl.imexp.ExportPhase _exportPhase
      • _exportCache

        protected boolean _exportCache
    • Constructor Detail

      • AbstractExcelExporter

        public AbstractExcelExporter()
    • Method Detail

      • exportColumnArray

        protected abstract void exportColumnArray​(SSheet sheet,
                                                  Sheet poiSheet,
                                                  SColumnArray columnArr)
      • createPoiBook

        protected abstract Workbook createPoiBook()
      • exportWorkbookProtection

        protected abstract void exportWorkbookProtection​(SWorkbookProtection workbookProtection)
      • exportChart

        protected abstract void exportChart​(SSheet sheet,
                                            Sheet poiSheet)
      • exportPicture

        protected abstract void exportPicture​(SSheet sheet,
                                              Sheet poiSheet)
      • exportValidation

        protected abstract void exportValidation​(SSheet sheet,
                                                 Sheet poiSheet)
      • exportAutoFilter

        protected abstract void exportAutoFilter​(SSheet sheet,
                                                 Sheet poiSheet)
      • exportSheetPr

        protected abstract void exportSheetPr​(SSheet sheet,
                                              Sheet poiSheet)
      • exportExtLst

        protected abstract void exportExtLst​(SSheet sheet,
                                             Sheet poiSheet)
      • exportPassword

        protected abstract void exportPassword​(SSheet sheet,
                                               Sheet poiSheet)
      • exportTables

        protected abstract int exportTables​(SSheet sheet,
                                            Sheet poiSheet,
                                            int tbId)
      • exportConditionalFormatting

        protected abstract void exportConditionalFormatting​(SSheet sheet,
                                                            Sheet poiSheet)
      • export

        public void export​(SBook book,
                           OutputStream fos)
                    throws IOException
        Export the model according to reversed depended order: book, sheet, defined name, cells, chart, pictures, validation. Because named ranges (defined names) require sheet index, they should be imported after sheets created. Besides, cells, charts, and validations may have formulas referring to named ranges, they must be imported after named ranged. Pictures depend on cells.
        Parameters:
        book - the book to export
        fos - the output stream to store data
        Throws:
        IOException
      • exportPictureData

        protected void exportPictureData​(SBook book)
      • exportNamedRange

        protected void exportNamedRange​(SBook book)
      • exportSheet

        protected void exportSheet​(SSheet sheet)
      • exportMergedRegions

        protected void exportMergedRegions​(SSheet sheet,
                                           Sheet poiSheet)
      • exportRowColumn

        protected void exportRowColumn​(SSheet sheet,
                                       Sheet poiSheet)
      • exportRow

        protected void exportRow​(SSheet sheet,
                                 Sheet poiSheet,
                                 SRow row)
      • exportCell

        protected void exportCell​(Row poiRow,
                                  SCell cell)
      • getFormulaString

        protected String getFormulaString​(SCell cell)
      • toPOIColor

        protected Color toPOIColor​(SColor color)
      • toPOIFont

        protected Font toPOIFont​(SFont font)
        Convert ZSS Font into POI Font. Cache font in the fontTable. If font exist, don't create a new one.
        Parameters:
        font -
        Returns:
      • exportSheetProtection

        protected void exportSheetProtection​(SSheet sheet,
                                             Sheet poiSheet)
        POI SheetProtection.
        Parameters:
        sheet - destination sheet
        poiSheet - source POI sheet
      • setExportCache

        public void setExportCache​(boolean b)
        Set whether export cached value into excel file(must be called before export() is called.
        Parameters:
        b -
        Since:
        3.7.0
      • isExportCache

        protected boolean isExportCache()
        Returns whether export cached value into excel file.
        Returns:
        Since:
        3.7.0
      • addPOIDxfCellStyle

        protected void addPOIDxfCellStyle​(SExtraStyle extraStyle)
        Add DxfCellStyle as poi Dxf.
        Parameters:
        extraStyle -
        Since:
        3.8.2
      • addPOITableStyle

        protected void addPOITableStyle​(STableStyle tableStyle)
        Add TableStyle as poi TableStyle
        Parameters:
        tableStyle -
        Since:
        3.8.3