Package org.adempiere.impexp
Class AbstractExcelExporter
java.lang.Object
org.adempiere.impexp.AbstractExcelExporter
- Direct Known Subclasses:
GridTabExcelExporter,PrintDataExcelExporter
Abstract MS Excel Format (xls) Exporter
- Author:
- Teo Sarca, SC ARHIPAC SERVICE SRL
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcreateHeaderFooter(org.apache.poi.hssf.usermodel.HSSFSheet sheet) Create sheet header and footerprotected voidcreateParameter(org.apache.poi.hssf.usermodel.HSSFSheet sheet) Create parametervoidExport to filevoidExport to fileprotected voidexport(OutputStream out) Export to given streamvoidexportToWorkbook(org.apache.poi.hssf.usermodel.HSSFWorkbook workbook, Language language) Export to work bookprotected voidformatPage(org.apache.poi.hssf.usermodel.HSSFSheet sheet) Format sheetprotected StringgetCellFormat(int row, int col) abstract intGet Columns Countprotected PropertiesgetCtx()protected abstract intabstract intgetDisplayType(int row, int col) Get cell display type (seeDisplayType)protected org.apache.poi.hssf.usermodel.HSSFCellgetFormCell(org.apache.poi.hssf.usermodel.HSSFRow row, int colnum) get cell for column. use for form layoutprotected org.apache.poi.hssf.usermodel.HSSFRowgetFormRow(org.apache.poi.hssf.usermodel.HSSFSheet sheet, int colnum) get row for column. use for form layoutabstract StringgetHeaderName(int col) Get column header nameprotected Languageprotected intabstract intGet Rows Countabstract ObjectgetValueAt(int row, int col) Get cell valueabstract booleanisColumnPrinted(int col) Check if column is printed (displayed)protected booleanabstract booleanisDisplayed(int row, int col) Check if there is a display logicprotected booleanisForm()abstract booleanIs the current Row a Function Rowabstract booleanisPageBreak(int row, int col) Check if there is a page break on given cellprotected booleanisSetFormRowPosition(int col) protected booleanisSuppressNull(int col) protected booleanisVisible(int row, int col) protected abstract voidsetCurrentRow(int row) Set current rowprotected voidsetCurrentRowOnly(boolean b) protected voidsetFreezePane(int colSplit, int rowSplit) protected voidsetNoOfParameter(int noOfParameter)
-
Field Details
-
log
Logger -
m_workbook
protected org.apache.poi.hssf.usermodel.HSSFWorkbook m_workbook -
m_lang
-
colSuppressRepeats
-
-
Constructor Details
-
AbstractExcelExporter
public AbstractExcelExporter()Default constructor
-
-
Method Details
-
isFunctionRow
public abstract boolean isFunctionRow()Is the current Row a Function Row- Returns:
- true if function row
-
getColumnCount
public abstract int getColumnCount()Get Columns Count- Returns:
- number of columns
-
getRowCount
public abstract int getRowCount()Get Rows Count- Returns:
- number of rows
-
setCurrentRow
protected abstract void setCurrentRow(int row) Set current row- Parameters:
row- row index
-
getCurrentRow
protected abstract int getCurrentRow()- Returns:
- current row index
-
isColumnPrinted
public abstract boolean isColumnPrinted(int col) Check if column is printed (displayed)- Parameters:
col- column index- Returns:
- true if is visible
-
getHeaderName
Get column header name- Parameters:
col- column index- Returns:
- header name
-
getDisplayType
public abstract int getDisplayType(int row, int col) Get cell display type (seeDisplayType)- Parameters:
row- row indexcol- column index- Returns:
- display type
-
getValueAt
Get cell value- Parameters:
row- row indexcol- column index- Returns:
- cell value
-
isPageBreak
public abstract boolean isPageBreak(int row, int col) Check if there is a page break on given cell- Parameters:
row- row indexcol- column index- Returns:
- true if there is a page break
-
isDisplayed
public abstract boolean isDisplayed(int row, int col) Check if there is a display logic- Parameters:
row- row indexcol- column index- Returns:
- true if there is no logic or evaluate logic specified in print item
-
getCtx
-
setFreezePane
protected void setFreezePane(int colSplit, int rowSplit) - Parameters:
colSplit- column index to freezerowSplit- row index to freeze
-
getLanguage
- Returns:
- Language
-
getCellFormat
- Parameters:
row-col-- Returns:
- Excel format pattern for cell
-
getNoOfParameter
protected int getNoOfParameter()- Returns:
- number of parameter
-
setNoOfParameter
protected void setNoOfParameter(int noOfParameter) - Parameters:
noOfParameter-
-
createParameter
protected void createParameter(org.apache.poi.hssf.usermodel.HSSFSheet sheet) Create parameter- Parameters:
sheet-
-
formatPage
protected void formatPage(org.apache.poi.hssf.usermodel.HSSFSheet sheet) Format sheet- Parameters:
sheet-
-
isCurrentRowOnly
protected boolean isCurrentRowOnly()- Returns:
- true if export current record only
-
setCurrentRowOnly
protected void setCurrentRowOnly(boolean b) - Parameters:
b-
-
export
Export to given stream- Parameters:
out-- Throws:
Exception
-
export
Export to file- Parameters:
file-language- reporting language- Throws:
Exception
-
export
Export to file- Parameters:
file-language- reporting languageautoOpen- auto open file after generated- Throws:
Exception
-
exportToWorkbook
public void exportToWorkbook(org.apache.poi.hssf.usermodel.HSSFWorkbook workbook, Language language) throws Exception Export to work book- Parameters:
workbook-language-- Throws:
Exception
-
isForm
protected boolean isForm()- Returns:
- true if it is form layout
-
isVisible
protected boolean isVisible(int row, int col) - Parameters:
row-col-- Returns:
- true if cell is visible
-
isSuppressNull
protected boolean isSuppressNull(int col) - Parameters:
col-- Returns:
- true if column should be hidden when it is null
-
isSetFormRowPosition
protected boolean isSetFormRowPosition(int col) - Parameters:
col-- Returns:
- true if column is use to set new row position
-
getFormCell
protected org.apache.poi.hssf.usermodel.HSSFCell getFormCell(org.apache.poi.hssf.usermodel.HSSFRow row, int colnum) get cell for column. use for form layout- Parameters:
row-colnum-- Returns:
- cell for column
-
getFormRow
protected org.apache.poi.hssf.usermodel.HSSFRow getFormRow(org.apache.poi.hssf.usermodel.HSSFSheet sheet, int colnum) get row for column. use for form layout- Parameters:
sheet-colnum-- Returns:
- row for column
-