Package org.adempiere.print.export
Class PrintDataExcelExporter
java.lang.Object
org.adempiere.impexp.AbstractExcelExporter
org.adempiere.print.export.PrintDataExcelExporter
Export PrintData to Excel (XLS) file
- Author:
- Teo Sarca, SC ARHIPAC SERVICE SRL
- BF [ 1939010 ] Excel Export ERROR - java.sql.Date - integrated Mario Grigioni's fix
- BF [ 1974309 ] Exporting a report to XLS is not setting page format
-
Field Summary
Fields inherited from class org.adempiere.impexp.AbstractExcelExporter
colSuppressRepeats, log, m_lang, m_workbook
-
Constructor Summary
ConstructorDescriptionPrintDataExcelExporter
(PrintData printData, MPrintFormat printFormat) PrintDataExcelExporter
(PrintData printData, MPrintFormat printFormat, Map<MPrintFormatItem, PrintData> childPrintFormatDetails, Boolean[] colSuppressRepeats) PrintDataExcelExporter
(PrintData printData, MPrintFormat printFormat, Map<MPrintFormatItem, PrintData> childPrintFormatDetails, Boolean[] colSuppressRepeats, MQuery query) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
createParameter
(org.apache.poi.hssf.usermodel.HSSFSheet sheet) Create parameterprotected void
export
(OutputStream out) Export to given streamprotected void
formatPage
(org.apache.poi.hssf.usermodel.HSSFSheet sheet) Format sheetprotected String
getCellFormat
(int row, int col) int
Get Columns Countprotected int
int
getDisplayType
(int row, int col) Get cell display type (seeDisplayType
)protected org.apache.poi.hssf.usermodel.HSSFCell
getFormCell
(org.apache.poi.hssf.usermodel.HSSFRow row, int colnum) get cell for column. use for form layoutprotected org.apache.poi.hssf.usermodel.HSSFRow
getFormRow
(org.apache.poi.hssf.usermodel.HSSFSheet sheet, int colnum) get row for column. use for form layoutgetHeaderName
(int col) Get column header nameint
Get Rows CountgetValueAt
(int row, int col) Get cell valueboolean
isColumnPrinted
(int col) Check if column is printed (displayed)boolean
isDisplayed
(int row, int col) Check if there is a display logicprotected boolean
isForm()
boolean
Is the current Row a Function Rowboolean
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 void
setCurrentRow
(int row) Set current rowMethods inherited from class org.adempiere.impexp.AbstractExcelExporter
createHeaderFooter, export, export, exportToWorkbook, getCtx, getLanguage, getNoOfParameter, isCurrentRowOnly, setCurrentRowOnly, setFreezePane, setNoOfParameter
-
Constructor Details
-
PrintDataExcelExporter
- Parameters:
printData
-printFormat
-
-
PrintDataExcelExporter
public PrintDataExcelExporter(PrintData printData, MPrintFormat printFormat, Map<MPrintFormatItem, PrintData> childPrintFormatDetails, Boolean[] colSuppressRepeats) - Parameters:
printData
-printFormat
-childPrintFormatDetails
-colSuppressRepeats
-
-
PrintDataExcelExporter
public PrintDataExcelExporter(PrintData printData, MPrintFormat printFormat, Map<MPrintFormatItem, PrintData> childPrintFormatDetails, Boolean[] colSuppressRepeats, MQuery query) - Parameters:
printData
-printFormat
-childPrintFormatDetails
-colSuppressRepeats
-query
-
-
-
Method Details
-
getColumnCount
public int getColumnCount()Description copied from class:AbstractExcelExporter
Get Columns Count- Specified by:
getColumnCount
in classAbstractExcelExporter
- Returns:
- number of columns
-
getDisplayType
public int getDisplayType(int row, int col) Description copied from class:AbstractExcelExporter
Get cell display type (seeDisplayType
)- Specified by:
getDisplayType
in classAbstractExcelExporter
- Parameters:
row
- row indexcol
- column index- Returns:
- display type
-
getValueAt
Description copied from class:AbstractExcelExporter
Get cell value- Specified by:
getValueAt
in classAbstractExcelExporter
- Parameters:
row
- row indexcol
- column index- Returns:
- cell value
-
getHeaderName
Description copied from class:AbstractExcelExporter
Get column header name- Specified by:
getHeaderName
in classAbstractExcelExporter
- Parameters:
col
- column index- Returns:
- header name
-
getRowCount
public int getRowCount()Description copied from class:AbstractExcelExporter
Get Rows Count- Specified by:
getRowCount
in classAbstractExcelExporter
- Returns:
- number of rows
-
isColumnPrinted
public boolean isColumnPrinted(int col) Description copied from class:AbstractExcelExporter
Check if column is printed (displayed)- Specified by:
isColumnPrinted
in classAbstractExcelExporter
- Parameters:
col
- column index- Returns:
- true if is visible
-
isPageBreak
public boolean isPageBreak(int row, int col) Description copied from class:AbstractExcelExporter
Check if there is a page break on given cell- Specified by:
isPageBreak
in classAbstractExcelExporter
- Parameters:
row
- row indexcol
- column index- Returns:
- true if there is a page break
-
setCurrentRow
protected void setCurrentRow(int row) Description copied from class:AbstractExcelExporter
Set current row- Specified by:
setCurrentRow
in classAbstractExcelExporter
- Parameters:
row
- row index
-
getCurrentRow
protected int getCurrentRow()- Specified by:
getCurrentRow
in classAbstractExcelExporter
- Returns:
- current row index
-
isFunctionRow
public boolean isFunctionRow()Description copied from class:AbstractExcelExporter
Is the current Row a Function Row- Specified by:
isFunctionRow
in classAbstractExcelExporter
- Returns:
- true if function row
-
formatPage
protected void formatPage(org.apache.poi.hssf.usermodel.HSSFSheet sheet) Description copied from class:AbstractExcelExporter
Format sheet- Overrides:
formatPage
in classAbstractExcelExporter
-
getCellFormat
- Overrides:
getCellFormat
in classAbstractExcelExporter
- Returns:
- Excel format pattern for cell
-
export
Description copied from class:AbstractExcelExporter
Export to given stream- Overrides:
export
in classAbstractExcelExporter
- Throws:
Exception
-
createParameter
protected void createParameter(org.apache.poi.hssf.usermodel.HSSFSheet sheet) Description copied from class:AbstractExcelExporter
Create parameter- Overrides:
createParameter
in classAbstractExcelExporter
-
isForm
protected boolean isForm()- Overrides:
isForm
in classAbstractExcelExporter
- Returns:
- true if it is form layout
-
getFormCell
protected org.apache.poi.hssf.usermodel.HSSFCell getFormCell(org.apache.poi.hssf.usermodel.HSSFRow row, int colnum) Description copied from class:AbstractExcelExporter
get cell for column. use for form layout- Overrides:
getFormCell
in classAbstractExcelExporter
- Returns:
- cell for column
-
getFormRow
protected org.apache.poi.hssf.usermodel.HSSFRow getFormRow(org.apache.poi.hssf.usermodel.HSSFSheet sheet, int colnum) Description copied from class:AbstractExcelExporter
get row for column. use for form layout- Overrides:
getFormRow
in classAbstractExcelExporter
- Returns:
- row for column
-
isSetFormRowPosition
protected boolean isSetFormRowPosition(int col) - Overrides:
isSetFormRowPosition
in classAbstractExcelExporter
- Returns:
- true if column is use to set new row position
-
isSuppressNull
protected boolean isSuppressNull(int col) - Overrides:
isSuppressNull
in classAbstractExcelExporter
- Returns:
- true if column should be hidden when it is null
-
isVisible
protected boolean isVisible(int row, int col) - Overrides:
isVisible
in classAbstractExcelExporter
- Returns:
- true if cell is visible
-
isDisplayed
public boolean isDisplayed(int row, int col) Description copied from class:AbstractExcelExporter
Check if there is a display logic- Specified by:
isDisplayed
in classAbstractExcelExporter
- Parameters:
row
- row indexcol
- column index- Returns:
- true if there is no logic or evaluate logic specified in print item
-