Compiere 3.1

org.compiere.excel
Class Excel

java.lang.Object
  extended by org.compiere.excel.Excel

public class Excel
extends Object

Allow users to create Excel files from Compiere Data


Field Summary
static short CELLSTYLE_HEADER
           
static short CELLSTYLE_NONE
           
protected  org.apache.poi.hssf.usermodel.HSSFCellStyle cellStyleDate
           
protected  org.apache.poi.hssf.usermodel.HSSFCellStyle cellStyleInteger
           
protected  org.apache.poi.hssf.usermodel.HSSFCellStyle cellStyleNormal
           
protected  org.apache.poi.hssf.usermodel.HSSFCellStyle cellStyleNumber
           
static int DISPLAY_TYPE_DATE
           
static int DISPLAY_TYPE_INTEGER
           
static int DISPLAY_TYPE_NUMBER
           
static int DISPLAY_TYPE_STRING
           
protected  String fileName
           
protected  FileOutputStream fileOut
           
protected  org.apache.poi.hssf.usermodel.HSSFDataFormat format
           
protected  org.apache.poi.hssf.usermodel.HSSFCellStyle HEADER
           
protected static CLogger s_log
           
protected  org.apache.poi.hssf.usermodel.HSSFSheet sheet
           
protected  org.apache.poi.hssf.usermodel.HSSFWorkbook wb
           
 
Constructor Summary
Excel()
           
Excel(File file)
          Create Excel by passing in a Java file object
Excel(String fileName)
          Create Excel file
 
Method Summary
 void close()
          Close the Excel file.
 Excel createExcel(JTable table)
          Export Excel
 void createRow(short rowPos, short cellPos, Object s, String str, short cellStyle, int displayType)
          Create new Row or Cell.
static Map<Integer,Map> Parsing(String fileName)
          Lecture d'un fichier Excel
 void setFileOutputStream(File f)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

s_log

protected static CLogger s_log

CELLSTYLE_HEADER

public static final short CELLSTYLE_HEADER
See Also:
Constant Field Values

CELLSTYLE_NONE

public static final short CELLSTYLE_NONE
See Also:
Constant Field Values

wb

protected org.apache.poi.hssf.usermodel.HSSFWorkbook wb

sheet

protected org.apache.poi.hssf.usermodel.HSSFSheet sheet

format

protected org.apache.poi.hssf.usermodel.HSSFDataFormat format

cellStyleNormal

protected org.apache.poi.hssf.usermodel.HSSFCellStyle cellStyleNormal

cellStyleDate

protected org.apache.poi.hssf.usermodel.HSSFCellStyle cellStyleDate

cellStyleNumber

protected org.apache.poi.hssf.usermodel.HSSFCellStyle cellStyleNumber

cellStyleInteger

protected org.apache.poi.hssf.usermodel.HSSFCellStyle cellStyleInteger

fileOut

protected FileOutputStream fileOut

fileName

protected String fileName

HEADER

protected org.apache.poi.hssf.usermodel.HSSFCellStyle HEADER

DISPLAY_TYPE_STRING

public static final int DISPLAY_TYPE_STRING
See Also:
Constant Field Values

DISPLAY_TYPE_NUMBER

public static final int DISPLAY_TYPE_NUMBER
See Also:
Constant Field Values

DISPLAY_TYPE_INTEGER

public static final int DISPLAY_TYPE_INTEGER
See Also:
Constant Field Values

DISPLAY_TYPE_DATE

public static final int DISPLAY_TYPE_DATE
See Also:
Constant Field Values
Constructor Detail

Excel

public Excel(String fileName)
Create Excel file

Parameters:
fileName -

Excel

public Excel(File file)
Create Excel by passing in a Java file object

Parameters:
file -

Excel

public Excel()
Method Detail

setFileOutputStream

public void setFileOutputStream(File f)

close

public void close()
Close the Excel file.


createRow

public void createRow(short rowPos,
                      short cellPos,
                      Object s,
                      String str,
                      short cellStyle,
                      int displayType)
Create new Row or Cell.

Parameters:
rowPos - Position for the Row
cellPos - Position in the Cell
s - Object to be rendered
str - Object en format String si jamais l'Objet ne peut etre interpreter
cellStyle - : HEADER or NONE
displayType - : String/Number/Date

Parsing

public static Map<Integer,Map> Parsing(String fileName)
                                throws IOException
Lecture d'un fichier Excel

Throws:
IOException

createExcel

public Excel createExcel(JTable table)
Export Excel

Parameters:
excel -
table -
Returns:

Compiere 3.1

Compiere® is a registered trademark of ComPiere, Inc. ©2004-2008 HumanFlash.com All rights reserved.