Package org.adempiere.impexp
Class AbstractXLSXExporter
- java.lang.Object
-
- org.adempiere.impexp.AbstractXLSXExporter
-
- Direct Known Subclasses:
ArrayExcelExporter
,GridTabXLSXExporter
,PrintDataXLSXExporter
public abstract class AbstractXLSXExporter extends Object
Abstract MS Excel Format (xlsx) Exporter- Author:
- Deepak Pansheriya
-
-
Field Summary
Fields Modifier and Type Field Description protected Boolean[]
colSuppressRepeats
protected CLogger
log
Loggerprotected Language
m_lang
protected org.apache.poi.xssf.usermodel.XSSFWorkbook
m_workbook
-
Constructor Summary
Constructors Constructor Description AbstractXLSXExporter()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
createHeaderFooter(org.apache.poi.xssf.usermodel.XSSFSheet sheet)
protected void
createParameter(org.apache.poi.xssf.usermodel.XSSFSheet sheet)
void
export(File file, Language language)
Export to filevoid
export(File file, Language language, boolean autoOpen)
Export to fileprotected void
export(OutputStream out)
Export to given streamvoid
exportToWorkbook(org.apache.poi.xssf.usermodel.XSSFWorkbook workbook, Language language)
protected void
formatPage(org.apache.poi.xssf.usermodel.XSSFSheet sheet)
protected String
getCellFormat(int row, int col)
abstract int
getColumnCount()
Get Columns Countprotected Properties
getCtx()
protected abstract int
getCurrentRow()
abstract int
getDisplayType(int row, int col)
Get cell display type (seeDisplayType
)protected org.apache.poi.xssf.usermodel.XSSFCell
getFormCell(org.apache.poi.xssf.usermodel.XSSFRow row, int colnum)
get cell for column. use for form layoutprotected org.apache.poi.xssf.usermodel.XSSFRow
getFormRow(org.apache.poi.xssf.usermodel.XSSFSheet sheet, int colnum)
get row for column. use for form layoutabstract String
getHeaderName(int col)
Get column header nameprotected Language
getLanguage()
protected int
getNoOfParameter()
abstract int
getRowCount()
Get Rows Countabstract Object
getValueAt(int row, int col)
Get cell valueabstract boolean
isColumnPrinted(int col)
Check if column is printed (displayed)protected boolean
isCurrentRowOnly()
abstract boolean
isDisplayed(int row, int col)
Check if there is a display logicprotected boolean
isForm()
abstract boolean
isFunctionRow()
Is the current Row a Function Rowabstract boolean
isPageBreak(int row, int col)
Check if there is a page break on given cellprotected boolean
isSetFormRowPosition(int col)
protected boolean
isSuppressNull(int col)
protected boolean
isVisible(int row, int col)
protected abstract void
setCurrentRow(int row)
Set current rowprotected void
setCurrentRowOnly(boolean b)
protected void
setFreezePane(int colSplit, int rowSplit)
protected void
setNoOfParameter(int noOfParameter)
-
-
-
Method Detail
-
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
public abstract String getHeaderName(int col)
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
public abstract Object getValueAt(int row, int col)
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
protected Properties getCtx()
-
setFreezePane
protected void setFreezePane(int colSplit, int rowSplit)
-
getLanguage
protected Language getLanguage()
-
getCellFormat
protected String getCellFormat(int row, int col)
-
createHeaderFooter
protected void createHeaderFooter(org.apache.poi.xssf.usermodel.XSSFSheet sheet)
-
formatPage
protected void formatPage(org.apache.poi.xssf.usermodel.XSSFSheet sheet)
-
isCurrentRowOnly
protected boolean isCurrentRowOnly()
-
setCurrentRowOnly
protected void setCurrentRowOnly(boolean b)
-
export
protected void export(OutputStream out) throws Exception
Export to given stream- Parameters:
out
-- Throws:
Exception
-
export
public void export(File file, Language language) throws Exception
Export to file- Parameters:
file
-language
- reporting language- Throws:
Exception
-
export
public void export(File file, Language language, boolean autoOpen) throws Exception
Export to file- Parameters:
file
-language
- reporting languageautoOpen
- auto open file after generated- Throws:
Exception
-
exportToWorkbook
public void exportToWorkbook(org.apache.poi.xssf.usermodel.XSSFWorkbook workbook, Language language) throws Exception
- Throws:
Exception
-
isForm
protected boolean isForm()
- Returns:
- true if it is form layout
-
getNoOfParameter
protected int getNoOfParameter()
-
setNoOfParameter
protected void setNoOfParameter(int noOfParameter)
-
createParameter
protected void createParameter(org.apache.poi.xssf.usermodel.XSSFSheet sheet)
-
isVisible
protected boolean isVisible(int row, int col)
- Parameters:
row
-col
-- Returns:
- true if column 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.xssf.usermodel.XSSFCell getFormCell(org.apache.poi.xssf.usermodel.XSSFRow row, int colnum)
get cell for column. use for form layout- Parameters:
row
-colnum
-- Returns:
- cell for column
-
getFormRow
protected org.apache.poi.xssf.usermodel.XSSFRow getFormRow(org.apache.poi.xssf.usermodel.XSSFSheet sheet, int colnum)
get row for column. use for form layout- Parameters:
sheet
-colnum
-- Returns:
- row for column
-
-