B4J Programming Press on the image to return to the main documentation page.

jPOI

List of types:

PoiCell
PoiCellStyle
PoiFont
PoiRow
PoiSheet
PoiWorkbook

PoiCell


Events:

None

Members:


  CellStyle As PoiCellStyle

  CellType As Int

  ColumnIndex As Int [read only]

  IsInitialized As Boolean

  TYPE_BLANK As Int

  TYPE_BOOLEAN As Int

  TYPE_ERROR As Int

  TYPE_FORMULA As Int

  TYPE_NUMERIC As Int

  TYPE_STRING As Int

  Value As Object [read only]

  ValueBoolean As Boolean

  ValueDate As Long

  ValueFormula As String

  ValueNumeric As Double

  ValueString As String

Members description:

CellStyle As PoiCellStyle
Gets or sets the cell style object.
PoiCellStyle objects can be shared by multiple cells (if the style is the same).
CellType As Int
Gets or sets the cell's type. The value will be one of the TYPE constants.
ColumnIndex As Int [read only]
Gets the cell column index.
IsInitialized As Boolean
TYPE_BLANK As Int
TYPE_BOOLEAN As Int
TYPE_ERROR As Int
TYPE_FORMULA As Int
TYPE_NUMERIC As Int
TYPE_STRING As Int
Value As Object [read only]
Returns the cell value based on the cell type.
ValueBoolean As Boolean
Gets or sets the value of a boolean cell.
ValueDate As Long
Gets or sets the value of a date cell.
ValueFormula As String
Gets or sets the value of a formula cell.
ValueNumeric As Double
Gets or sets the value of a numeric cell.
ValueString As String
Gets or sets the value of a string cell.

PoiCellStyle


Events:

None

Members:


  BORDER_DASH_DOT As Short

  BORDER_DASH_DOT_DOT As Short

  BORDER_DASHED As Short

  BORDER_DOTTED As Short

  BORDER_DOUBLE As Short

  BORDER_HAIR As Short

  BORDER_MEDIUM As Short

  BORDER_MEDIUM_DASH_DOT As Short

  BORDER_MEDIUM_DASH_DOT_DOT As Short

  BORDER_MEDIUM_DASHED As Short

  BORDER_NONE As Short

  BORDER_SLANTED_DASH_DOT As Short

  BORDER_THICK As Short

  BORDER_THIN As Short

  BorderBottom As Short

  BorderLeft As Short

  BorderRight As Short

  BorderTop As Short

  ForegroundColor As javafx.scene.paint.Paint [write only]

  HORIZONTAL_CENTER As Short

  HORIZONTAL_FILL As Short

  HORIZONTAL_GENERAL As Short

  HORIZONTAL_JUSTIFY As Short

  HORIZONTAL_LEFT As Short

  HORIZONTAL_RIGHT As Short

  HorizontalAlignment As Short

  Initialize (Workbook As PoiWorkbook)

  InitializeCopy (Workbook As PoiWorkbook, ExistingStyle As PoiCellStyle)

  IsInitialized As Boolean

  Rotation As Short

  SetDataFormat (Workbook As PoiWorkbook, Format As String)

  SetFont (Font As PoiFont)

  ShrinkToFit As Boolean

  VERTICAL_BOTTOM As Short

  VERTICAL_CENTER As Short

  VERTICAL_JUSTIFY As Short

  VERTICAL_TOP As Short

  VerticalAlignment As Short

  WrapText As Boolean

Members description:

BORDER_DASH_DOT As Short
BORDER_DASH_DOT_DOT As Short
BORDER_DASHED As Short
BORDER_DOTTED As Short
BORDER_DOUBLE As Short
BORDER_HAIR As Short
BORDER_MEDIUM As Short
BORDER_MEDIUM_DASH_DOT As Short
BORDER_MEDIUM_DASH_DOT_DOT As Short
BORDER_MEDIUM_DASHED As Short
BORDER_NONE As Short
BORDER_SLANTED_DASH_DOT As Short
BORDER_THICK As Short
BORDER_THIN As Short
BorderBottom As Short
Gets or sets the border style. One of the BORDER constants.
BorderLeft As Short
Gets or sets the border style. One of the BORDER constants.
BorderRight As Short
Gets or sets the border style. One of the BORDER constants.
BorderTop As Short
Gets or sets the border style. One of the BORDER constants.
ForegroundColor As javafx.scene.paint.Paint [write only]
Sets the cell's color.
This method is only supported when working with xlsx workbooks (nothing will happen with xls format).
HORIZONTAL_CENTER As Short
HORIZONTAL_FILL As Short
HORIZONTAL_GENERAL As Short
The default alignment.
HORIZONTAL_JUSTIFY As Short
HORIZONTAL_LEFT As Short
HORIZONTAL_RIGHT As Short
HorizontalAlignment As Short
Gets or sets the horizontal alignment. One of the HORIZONTAL constants.
Initialize (Workbook As PoiWorkbook)
Creates a new CellStyle. Note that you should avoid creating unnecessary PoiCellStyles objects.
InitializeCopy (Workbook As PoiWorkbook, ExistingStyle As PoiCellStyle)
Creates a new CellStyle which is a copy of the given CellStyle.
This is useful if you want to create another style similar to an existing style.
IsInitialized As Boolean
Rotation As Short
Gets or sets the degree of rotation (between -90 to 90).
SetDataFormat (Workbook As PoiWorkbook, Format As String)
Sets the data format string.
SetFont (Font As PoiFont)
ShrinkToFit As Boolean
Gets or sets whether the cells will be auto sized to fit.
VERTICAL_BOTTOM As Short
VERTICAL_CENTER As Short
VERTICAL_JUSTIFY As Short
VERTICAL_TOP As Short
VerticalAlignment As Short
Gets or sets the vertical alignment. One of the VERTICAL constants.
WrapText As Boolean
Gets or sets whether the text should be wrapped.

PoiFont


Events:

None

Members:


  Bold As Boolean

  Initialize (Workbook As PoiWorkbook)

  IsInitialized As Boolean

  Italic As Boolean

  Name As String

  SetColor (Color As javafx.scene.paint.Paint)

  Size As Short

  Underline As Boolean

Members description:

Bold As Boolean
Initialize (Workbook As PoiWorkbook)
IsInitialized As Boolean
Italic As Boolean
Name As String
Gets or sets the font name.
SetColor (Color As javafx.scene.paint.Paint)
Size As Short
Gets or sets the font size.
Underline As Boolean

PoiRow


Events:

None

Members:


  Cells As List [read only]

  CreateCellBoolean (CellIndex As Int, Value As Boolean) As PoiCell

  CreateCellFormula (CellIndex As Int, Value As String) As PoiCell

  CreateCellNumeric (CellIndex As Int, Value As Double) As PoiCell

  CreateCellString (CellIndex As Int, Value As String) As PoiCell

  GetCell (Column As Int) As PoiCell

  Height As Float

  IsInitialized As Boolean

  RowNumber As Int

  RowStyle As PoiCellStyle

Members description:

Cells As List [read only]
Returns a List with PoiCell items representing the row defined cells.
CreateCellBoolean (CellIndex As Int, Value As Boolean) As PoiCell
Creates a boolean cell at the given index.
CreateCellFormula (CellIndex As Int, Value As String) As PoiCell
Creates a formula cell at the given index.
CreateCellNumeric (CellIndex As Int, Value As Double) As PoiCell
Creates a numeric cell at the given index.
CreateCellString (CellIndex As Int, Value As String) As PoiCell
Creates a string cell at the given index.
GetCell (Column As Int) As PoiCell
Returns the cell at the given index.
The object will not uninitialized if there is no defined cell.
Height As Float
Gets or sets the row height.
IsInitialized As Boolean
RowNumber As Int
Gets or sets the row number.
RowStyle As PoiCellStyle
Gets or sets the row style.
The object returned will be uninitialized if the style was not set before.

PoiSheet


Events:

None

Members:


  AddMergedRegion (FirstColumn As Int, FirstRow As Int, LastColumn As Int, LastRow As Int)

  CreateRow (RowNumber As Int) As PoiRow

  FirstRowNumber As Int [read only]

  GetColumnWidth (ColumnIndex As Int) As Int

  GetRow (RowNumber As Int) As PoiRow

  Index As Int [read only]

  IsInitialized As Boolean

  LastRowNumber As Int [read only]

  Name As String

  RightToLeft As Boolean

  Rows As List [read only]

  SetColumnWidth (ColumnIndex As Int, Width As Int)

  SetImage (ImageIndex As Int, FirstColumn As Int, FirstRow As Int, LastColumn As Int, LastRow As Int)

Members description:

AddMergedRegion (FirstColumn As Int, FirstRow As Int, LastColumn As Int, LastRow As Int)
Merges the cells.
CreateRow (RowNumber As Int) As PoiRow
Creates a new row with the specified index. First row index is 0.
FirstRowNumber As Int [read only]
Gets the index of the first row on the sheet.
GetColumnWidth (ColumnIndex As Int) As Int
Gets the column width measured in 1 / 256 of a character width.
GetRow (RowNumber As Int) As PoiRow
Returns the row with the specified index. Returns an uninitialized PoiRow if the row is empty.
Index As Int [read only]
Returns the sheet index.
IsInitialized As Boolean
LastRowNumber As Int [read only]
Gets the index of the last row on the sheet.
Name As String
Gets or sets the sheet name.
RightToLeft As Boolean
Gets or sets whether the sheet is in right to left mode.
Rows As List [read only]
Returns a List with PoiRow items representing the sheet rows.
Note that empty rows will be excluded from the list.
SetColumnWidth (ColumnIndex As Int, Width As Int)
Sets the column width measured in 1 / 256 of a character width.
SetImage (ImageIndex As Int, FirstColumn As Int, FirstRow As Int, LastColumn As Int, LastRow As Int)
Puts an image, previously added with PoiWorkbook.AddImage, on the sheet.
ImageIndex - The value returned from PoiWorkbook.AddImage.
FirstRow, FirstColumn, LastRow, LastColumn - The image cells.

PoiWorkbook


Events:

Ready (Success As Boolean)

Members:


  AddImage (Dir As String, FileName As String) As Int

  AddSheet (Name As String, Index As Int) As PoiSheet

  Close

  GetSheet (Index As Int) As PoiSheet

  GetSheetNames As String()

  InitializeExisting (Dir As String, FileName As String, Password As String)

  InitializeExistingAsync (EventName As String, Dir As String, FileName As String, Password As String)

  InitializeNew (XLSXFormat As Boolean)

  IsInitialized As Boolean

  NumberOfSheets As Int [read only]

  PICTURE_TYPE_JPEG As Short

  PICTURE_TYPE_PNG As Short

  Save (Dir As String, FileName As String)

Members description:

AddImage (Dir As String, FileName As String) As Int
Adds an image to the workbook. Returns the image index.
Use PoiSheet.SetImage to put this image on a sheet.
Supported formats: png and jpeg (file extension must be correct).
AddSheet (Name As String, Index As Int) As PoiSheet
Adds a new sheet at the specified index.
Close
Closes the Workbook.
GetSheet (Index As Int) As PoiSheet
Returns the sheet at the specified index (first sheet index is 0).
GetSheetNames As String()
Returns an array with the sheets names.
InitializeExisting (Dir As String, FileName As String, Password As String)
Initializes the workbook and reads the data from the specified file.
Password - The workbook password. Pass an empty string if there is no password.
InitializeExistingAsync (EventName As String, Dir As String, FileName As String, Password As String)
Similar to InitializeExisting. This method is non-blocking. The Ready event will be fired when the workbook is ready.
InitializeNew (XLSXFormat As Boolean)
Creates a new workbook.
XLSXFormat - True to use the new Excel 2007 format (xlsx).
IsInitialized As Boolean
NumberOfSheets As Int [read only]
Returns the number of sheets.
PICTURE_TYPE_JPEG As Short
PICTURE_TYPE_PNG As Short
Save (Dir As String, FileName As String)
Saves the workbook to the given file.
Top