Full API Reference
Classes
DataSetExcelWorkbook ⇐ ServoyExcelWorkbook
FoundSetExcelWorkbook ⇐ ServoyExcelWorkbook
Members
copies : Number
The number of copies
draft : Boolean
Whether it is in draft mode
fitHeight : Number
The number of pages high to fit the sheet in
fitWidth : Number
The number of pages high to fit the sheet in
landscape : Boolean
Whether to print in landscape
mergedRegionType : Object
noColor : Boolean
Whether it is black and white
paperSize : Number
The paper size
Functions
createPrintSetup() ⇒ PrintSetup
Creates a PrintSetup object that can be used in ExcelSheet.setPrintSetup() or to set the default print setup used when workbooks are created from FoundSet or DataSet
createWorkbook([templateOrFileType]) ⇒ ExcelWorkbook
Returns an empty ExcelWorkbook
createWorkbookFromDataSet(dataset, [columns], [headers], [templateOrFileType], [sheetNameToUse]) ⇒ DataSetExcelWorkbook
Creates an ExcelWorkbook from the given dataset
If a template is provided, the dataset will be inserted in the given sheet
createWorkbookFromFoundSet(foundset, dataproviders, [headers], [templateOrFileType], [sheetNameToUse]) ⇒ FoundSetExcelWorkbook
Creates an ExcelWorkbook from the given foundset
If a templateOrFileType is provided, the foundset will be inserted in the given sheet
getCellReferenceFromRange(firstRow, lastRow, firstColumn, lastColumn) ⇒ String
Creates a cell reference (e.g. "A4:C92") from the given range
getRangeFromCellReference(cellReference) ⇒ Object
Converts a cell reference (e.g. "B4:AK234" or "C6") to an object holding first and last row and column
getWorkbook(original) ⇒ ExcelWorkbook
Returns an ExcelWorkbook from the given file or media URL
isLoaded() ⇒ Boolean
If true, all required libraries are present and the scope can be used
Sets the default print setup used when workbooks are created from FoundSet or DataSet
DataSetExcelWorkbook ⇐ ServoyExcelWorkbook
ServoyExcelWorkbook
Extends: ServoyExcelWorkbook
DataSetExcelWorkbook ⇐
ServoyExcelWorkbook
inner
~dataFilled :
Boolean
instance
.getBytes() ⇒
[ 'Array' ].<byte>
.getDataSet() ⇒
JSDataSet
.getNumberOfSheets() ⇒
Number
.getSheetNameAt(index) ⇒
String
.getSheetNames() ⇒
[ 'Array' ].<String>
.writeToFile(targetFile) ⇒
Boolean
.autoSizeColumns :
Boolean
.columnFormats :
[ 'Array' ].<String>
.dataset :
JSDataSet
.defaultDateFormat :
String
.defaultNumberFormat :
String
.freezeFirstRow :
Boolean
.setAutoFilter :
Boolean
.sheetName :
String
.startColumn :
Number
.startRow :
Number
.wb :
Packages.org.apache.poi.ss.usermodel.Workbook
DataSetExcelWorkbook~dataFilled : Boolean
Boolean
dataSetExcelWorkbook.cloneCellStyle(cellStyle) ⇒ ExcelCellStyle
ExcelCellStyle
Clones the given ExcelCellStyle
Param | Type |
---|---|
cellStyle |
dataSetExcelWorkbook.cloneFont(font) ⇒ ExcelFont
ExcelFont
Clones the given font and returns a new ExcelFont
Param | Type |
---|---|
font |
dataSetExcelWorkbook.cloneSheet(indexToClone) ⇒ ExcelSheet
ExcelSheet
Creates an ExcelSheet from an existing sheet in the Workbook
Returns: ExcelSheet
- clone
Param | Type | Description |
---|---|---|
indexToClone |
| one based |
dataSetExcelWorkbook.close()
Closes this workbook
dataSetExcelWorkbook.createCellStyle() ⇒ ExcelCellStyle
ExcelCellStyle
Creates an empty ExcelCellStyle
dataSetExcelWorkbook.createColumnStyle(columnIndex) ⇒ ExcelCellStyle
ExcelCellStyle
Creates and returns an ExcelCellStyle used for a specific column
Param | Type |
---|---|
columnIndex |
|
dataSetExcelWorkbook.createFont() ⇒ ExcelFont
ExcelFont
Creates a font
dataSetExcelWorkbook.createHeaderStyle() ⇒ ExcelCellStyle
ExcelCellStyle
Creates and returns an ExcelCellStyle used for the header row
dataSetExcelWorkbook.createRowStyle() ⇒ ExcelCellStyle
ExcelCellStyle
Creates and returns an ExcelCellStyle used for a data row
dataSetExcelWorkbook.createSheet(sheetName) ⇒ ExcelSheet
ExcelSheet
Creates a sheet with the given name
This method makes sure that no illegal names are provided and might change the name if needed
Param | Type |
---|---|
sheetName |
|
dataSetExcelWorkbook.fillData()
Fills the sheet with the data of the foundset
This is automatically done when writeToFile()
or getBytes()
is called
Overrides: fillData
dataSetExcelWorkbook.getBytes() ⇒ [ 'Array' ].<byte>
[ 'Array' ].<byte>
Returns the data of this workbook as a byte[]
Returns: [ 'Array' ].<byte>
- bytes
dataSetExcelWorkbook.getDataSet() ⇒ JSDataSet
JSDataSet
Returns the dataset used to create this workbook
dataSetExcelWorkbook.getNumberOfSheets() ⇒ Number
Number
Returns the number of spreadsheets in the workbook
dataSetExcelWorkbook.getSheet(sheetName) ⇒ ExcelSheet
ExcelSheet
Returns the sheet with the given name (case insensitive match)
Param | Type |
---|---|
sheetName |
|
dataSetExcelWorkbook.getSheetAt(index) ⇒ ExcelSheet
ExcelSheet
Returns the ExcelSheet object at the given index
Param | Type |
---|---|
index |
|
dataSetExcelWorkbook.getSheetNameAt(index) ⇒ String
String
Returns the name of the sheet at the given index
Returns: String
- sheetName
Param | Type |
---|---|
index |
|
dataSetExcelWorkbook.getSheetNames() ⇒ [ 'Array' ].<String>
[ 'Array' ].<String>
Returns all sheet names
dataSetExcelWorkbook.removeSheetAt(index)
Removes the sheet at the given index
Param | Type |
---|---|
index |
|
dataSetExcelWorkbook.setFormatForColumn(columnIndex, format)
Sets a date or number format used for the given column
Param | Type |
---|---|
columnIndex |
|
format |
|
dataSetExcelWorkbook.setSheetNameAt(index, name)
Sets the sheet name
Param | Type |
---|---|
index |
|
name |
|
dataSetExcelWorkbook.writeToFile(targetFile) ⇒ Boolean
Boolean
Writes this workbook to the given file
Returns: Boolean
- success
Param | Type |
---|---|
targetFile |
|
dataSetExcelWorkbook.autoSizeColumns : Boolean
Boolean
Whether or not all data columns should be auto sized
dataSetExcelWorkbook.columnFormats : [ 'Array' ].<String>
[ 'Array' ].<String>
dataSetExcelWorkbook.columnStyles : [ 'Array' ].<ExcelCellStyle>
[ 'Array' ].<ExcelCellStyle>
dataSetExcelWorkbook.dataset : JSDataSet
JSDataSet
The dataset used to create this workbook
dataSetExcelWorkbook.defaultDateFormat : String
String
The default format used to format date values
This can be overriden for specific columns by calling setFormatForColumn()
dataSetExcelWorkbook.defaultNumberFormat : String
String
The default format used to format number values
This can be overriden for specific columns by calling setFormatForColumn()
dataSetExcelWorkbook.freezeFirstRow : Boolean
Boolean
Whether the header row is frozen or not
Overrides: freezeFirstRow
dataSetExcelWorkbook.headerStyle : ExcelCellStyle
ExcelCellStyle
The style used for the header of the data
Overrides: headerStyle
dataSetExcelWorkbook.rowStyle : ExcelCellStyle
ExcelCellStyle
The style used for a data cell
Overrides: rowStyle
dataSetExcelWorkbook.setAutoFilter : Boolean
Boolean
Whether or not the data columns should be auto filtered or not
Overrides: setAutoFilter
dataSetExcelWorkbook.sheet : ExcelSheet
ExcelSheet
The ExcelSheet used or created
dataSetExcelWorkbook.sheetName : String
String
The name of the sheet to be used
When a template is used, data will be inserted in the sheet with this name or the first best if not found
dataSetExcelWorkbook.startColumn : Number
Number
The first column where data will be inserted (one based)
dataSetExcelWorkbook.startRow : Number
Number
The first row where data will be inserted (one based)
dataSetExcelWorkbook.wb : Packages.org.apache.poi.ss.usermodel.Workbook
Packages.org.apache.poi.ss.usermodel.Workbook
The internal workbook object
dataSetExcelWorkbook.workbook : ExcelWorkbook
ExcelWorkbook
The ExcelWorkbook created
new DataSetExcelWorkbook(dataset, [columns], [headers], [templateOrFileType], [sheetNameToUse])
A DataSet based Excel workbook
Param | Type | Description |
---|---|---|
dataset |
| the dataset |
[columns] |
| the column numbers to be included in the sheet |
[headers] |
| the text to be used as column headers |
[templateOrFileType] |
| either file or media URL pointing to an existing Excel to be used as template or one of the FILE_FORMAT constants when creating empty workbooks |
[sheetNameToUse] |
| when a template is used, this is the name of the sheet to be filled |
Example
ExcelWorkbook
Suppresswarnings(deprecated): needs to be added to prevent warnings from deprecated WorkbookFactory.create(Object)
.getBytes() ⇒
[ 'Array' ].<byte>
.getNumberOfSheets() ⇒
Number
.getSheetNameAt(index) ⇒
String
.getSheetNames() ⇒
[ 'Array' ].<String>
.writeToFile(targetFile) ⇒
Boolean
.wb :
Packages.org.apache.poi.ss.usermodel.Workbook
excelWorkbook.cloneCellStyle(cellStyle) ⇒ ExcelCellStyle
ExcelCellStyle
Clones the given ExcelCellStyle
Param | Type |
---|---|
cellStyle |
excelWorkbook.cloneFont(font) ⇒ ExcelFont
ExcelFont
Clones the given font and returns a new ExcelFont
Param | Type |
---|---|
font |
excelWorkbook.cloneSheet(indexToClone) ⇒ ExcelSheet
ExcelSheet
Creates an ExcelSheet from an existing sheet in the Workbook
Returns: ExcelSheet
- clone
Param | Type | Description |
---|---|---|
indexToClone |
| one based |
excelWorkbook.close()
Closes this workbook
excelWorkbook.createCellStyle() ⇒ ExcelCellStyle
ExcelCellStyle
Creates an empty ExcelCellStyle
excelWorkbook.createFont() ⇒ ExcelFont
ExcelFont
Creates a font
excelWorkbook.createSheet(sheetName) ⇒ ExcelSheet
ExcelSheet
Creates a sheet with the given name
This method makes sure that no illegal names are provided and might change the name if needed
Param | Type |
---|---|
sheetName |
|
excelWorkbook.getBytes() ⇒ [ 'Array' ].<byte>
[ 'Array' ].<byte>
Returns this workbook as a byte[] array
excelWorkbook.getNumberOfSheets() ⇒ Number
Number
Returns the number of spreadsheets in the workbook
excelWorkbook.getSheet(sheetName) ⇒ ExcelSheet
ExcelSheet
Returns the sheet with the given name (case insensitive match)
Param | Type |
---|---|
sheetName |
|
excelWorkbook.getSheetAt(index) ⇒ ExcelSheet
ExcelSheet
Returns the ExcelSheet object at the given index
Param | Type |
---|---|
index |
|
excelWorkbook.getSheetNameAt(index) ⇒ String
String
Returns the name of the sheet at the given index
Returns: String
- sheetName
Param | Type |
---|---|
index |
|
excelWorkbook.getSheetNames() ⇒ [ 'Array' ].<String>
[ 'Array' ].<String>
Returns all sheet names
excelWorkbook.removeSheetAt(index)
Removes the sheet at the given index
Param | Type |
---|---|
index |
|
excelWorkbook.setSheetNameAt(index, name)
Sets the sheet name
Param | Type |
---|---|
index |
|
name |
|
excelWorkbook.writeToFile(targetFile) ⇒ Boolean
Boolean
Writes this workbook to the given targetFile
Returns: Boolean
- success
Param | Type |
---|---|
targetFile |
|
excelWorkbook.wb : Packages.org.apache.poi.ss.usermodel.Workbook
Packages.org.apache.poi.ss.usermodel.Workbook
The internal workbook object
new ExcelWorkbook([templateOrFileType])
Creates an empty Excel workbook or reads the one provided
Param | Type | Description |
---|---|---|
[templateOrFileType] |
| either a path, mediaUrl, JSFile or byte[] when reading an existing workbook or one of the FILE_FORMAT constants when creating empty workbooks |
Example
FoundSetExcelWorkbook ⇐ ServoyExcelWorkbook
ServoyExcelWorkbook
Extends: ServoyExcelWorkbook
FoundSetExcelWorkbook ⇐
ServoyExcelWorkbook
inner
~dataFilled :
Boolean
instance
.getBytes() ⇒
[ 'Array' ].<byte>
.getFoundSet() ⇒
JSFoundSet
.getNumberOfSheets() ⇒
Number
.getSheetNameAt(index) ⇒
String
.getSheetNames() ⇒
[ 'Array' ].<String>
.writeToFile(targetFile) ⇒
Boolean
.autoSizeColumns :
Boolean
.columnFormats :
[ 'Array' ].<String>
.defaultDateFormat :
String
.defaultNumberFormat :
String
.foundset :
JSFoundSet
.freezeFirstRow :
Boolean
.setAutoFilter :
Boolean
.sheetName :
String
.startColumn :
Number
.startRow :
Number
.wb :
Packages.org.apache.poi.ss.usermodel.Workbook
FoundSetExcelWorkbook~dataFilled : Boolean
Boolean
foundSetExcelWorkbook.cloneCellStyle(cellStyle) ⇒ ExcelCellStyle
ExcelCellStyle
Clones the given ExcelCellStyle
Param | Type |
---|---|
cellStyle |
foundSetExcelWorkbook.cloneFont(font) ⇒ ExcelFont
ExcelFont
Clones the given font and returns a new ExcelFont
Param | Type |
---|---|
font |
foundSetExcelWorkbook.cloneSheet(indexToClone) ⇒ ExcelSheet
ExcelSheet
Creates an ExcelSheet from an existing sheet in the Workbook
Returns: ExcelSheet
- clone
Param | Type | Description |
---|---|---|
indexToClone |
| one based |
foundSetExcelWorkbook.close()
Closes this workbook
foundSetExcelWorkbook.createCellStyle() ⇒ ExcelCellStyle
ExcelCellStyle
Creates an empty ExcelCellStyle
foundSetExcelWorkbook.createColumnStyle(columnIndex) ⇒ ExcelCellStyle
ExcelCellStyle
Creates and returns an ExcelCellStyle used for a specific column
Param | Type |
---|---|
columnIndex |
|
foundSetExcelWorkbook.createFont() ⇒ ExcelFont
ExcelFont
Creates a font
foundSetExcelWorkbook.createHeaderStyle() ⇒ ExcelCellStyle
ExcelCellStyle
Creates and returns an ExcelCellStyle used for the header row
foundSetExcelWorkbook.createRowStyle() ⇒ ExcelCellStyle
ExcelCellStyle
Creates and returns an ExcelCellStyle used for a data row
foundSetExcelWorkbook.createSheet(sheetName) ⇒ ExcelSheet
ExcelSheet
Creates a sheet with the given name
This method makes sure that no illegal names are provided and might change the name if needed
Param | Type |
---|---|
sheetName |
|
foundSetExcelWorkbook.fillData()
Fills the sheet with the data of the foundset
This is automatically done when writeToFile()
or getBytes()
is called
Overrides: fillData
foundSetExcelWorkbook.getBytes() ⇒ [ 'Array' ].<byte>
[ 'Array' ].<byte>
Returns the data of this workbook as a byte[]
Returns: [ 'Array' ].<byte>
- bytes
foundSetExcelWorkbook.getFoundSet() ⇒ JSFoundSet
JSFoundSet
Returns the foundset used to create this workbook
foundSetExcelWorkbook.getNumberOfSheets() ⇒ Number
Number
Returns the number of spreadsheets in the workbook
foundSetExcelWorkbook.getSheet(sheetName) ⇒ ExcelSheet
ExcelSheet
Returns the sheet with the given name (case insensitive match)
Param | Type |
---|---|
sheetName |
|
foundSetExcelWorkbook.getSheetAt(index) ⇒ ExcelSheet
ExcelSheet
Returns the ExcelSheet object at the given index
Param | Type |
---|---|
index |
|
foundSetExcelWorkbook.getSheetNameAt(index) ⇒ String
String
Returns the name of the sheet at the given index
Returns: String
- sheetName
Param | Type |
---|---|
index |
|
foundSetExcelWorkbook.getSheetNames() ⇒ [ 'Array' ].<String>
[ 'Array' ].<String>
Returns all sheet names
foundSetExcelWorkbook.removeSheetAt(index)
Removes the sheet at the given index
Param | Type |
---|---|
index |
|
foundSetExcelWorkbook.setFormatForColumn(columnIndex, format)
Sets a date or number format used for the given column
Param | Type |
---|---|
columnIndex |
|
format |
|
foundSetExcelWorkbook.setSheetNameAt(index, name)
Sets the sheet name
Param | Type |
---|---|
index |
|
name |
|
foundSetExcelWorkbook.writeToFile(targetFile) ⇒ Boolean
Boolean
Writes this workbook to the given file
Returns: Boolean
- success
Param | Type |
---|---|
targetFile |
|
foundSetExcelWorkbook.autoSizeColumns : Boolean
Boolean
Whether or not all data columns should be auto sized
foundSetExcelWorkbook.columnFormats : [ 'Array' ].<String>
[ 'Array' ].<String>
foundSetExcelWorkbook.columnStyles : [ 'Array' ].<ExcelCellStyle>
[ 'Array' ].<ExcelCellStyle>
foundSetExcelWorkbook.defaultDateFormat : String
String
The default format used to format date values
This can be overriden for specific columns by calling setFormatForColumn()
foundSetExcelWorkbook.defaultNumberFormat : String
String
The default format used to format number values
This can be overriden for specific columns by calling setFormatForColumn()
foundSetExcelWorkbook.foundset : JSFoundSet
JSFoundSet
The foundset used to create this workbook
foundSetExcelWorkbook.freezeFirstRow : Boolean
Boolean
Whether the header row is frozen or not
Overrides: freezeFirstRow
foundSetExcelWorkbook.headerStyle : ExcelCellStyle
ExcelCellStyle
The style used for the header of the data
Overrides: headerStyle
foundSetExcelWorkbook.rowStyle : ExcelCellStyle
ExcelCellStyle
The style used for a data cell
Overrides: rowStyle
foundSetExcelWorkbook.setAutoFilter : Boolean
Boolean
Whether or not the data columns should be auto filtered or not
Overrides: setAutoFilter
foundSetExcelWorkbook.sheet : ExcelSheet
ExcelSheet
The ExcelSheet used or created
foundSetExcelWorkbook.sheetName : String
String
The name of the sheet to be used
When a template is used, data will be inserted in the sheet with this name or the first best if not found
foundSetExcelWorkbook.startColumn : Number
Number
The first column where data will be inserted (one based)
foundSetExcelWorkbook.startRow : Number
Number
The first row where data will be inserted (one based)
foundSetExcelWorkbook.wb : Packages.org.apache.poi.ss.usermodel.Workbook
Packages.org.apache.poi.ss.usermodel.Workbook
The internal workbook object
foundSetExcelWorkbook.workbook : ExcelWorkbook
ExcelWorkbook
The ExcelWorkbook created
new FoundSetExcelWorkbook(foundset, dataproviders, [headers], [templateOrFileType], [sheetNameToUse])
A FoundSet based Excel workbook
Param | Type | Description |
---|---|---|
foundset |
| the foundset |
dataproviders |
| the dataproviders to be used for the excel sheet |
[headers] |
| the text to be used as column headers |
[templateOrFileType] |
| either file or media URL pointing to an existing Excel to be used as template or one of the FILE_FORMAT constants when creating empty workbooks |
[sheetNameToUse] |
| when a template is used, this is the name of the sheet to be filled |
ALIGNMENT : enum
enum
Horizontal alignments used in ExcelCellStyle
Properties
Name | Type | Default |
---|---|---|
CENTER |
|
|
CENTER_SELECTION |
|
|
FILL |
|
|
GENERAL |
|
|
JUSTIFY |
|
|
LEFT |
|
|
RIGHT |
|
|
DISTRIBUTED |
|
|
BORDER : enum
enum
Borders used in ExcelCellStyle
Properties
Name | Type | Default |
---|---|---|
DASH_DOT |
|
|
DASH_DOT_DOT |
|
|
DASHED |
|
|
DOTTED |
|
|
DOUBLE |
|
|
HAIR |
|
|
MEDIUM |
|
|
MEDIUM_DASH_DOT |
|
|
MEDIUM_DASH_DOT_DOT |
|
|
MEDIUM_DASHED |
|
|
NONE |
|
|
SLANTED_DASH_DOT |
|
|
THICK |
|
|
THIN |
|
|
CELL_TYPE
Possible cell types
Properties
Name | Default |
---|---|
BLANK |
|
BOOLEAN |
|
ERROR |
|
FORMULA |
|
NUMERIC |
|
STRING |
|
FILE_FORMAT
Possible file formats used instead of templates when creating empty workbooks
Properties
Name | Default | Description |
---|---|---|
XLS |
| XLS format |
XLSX |
| XLSX format, requires additional libraries @see https://github.com/Servoy/gitbook/blob/master/guides/develop/application-design/modules/svyutils/ExcelUtils.md |
SXLSX |
| Streaming version of the XLSX format to avoid out of memory errors |
FILL_PATTERN : enum
enum
Fill patterns used in ExcelCellStyle
Properties
Name | Type | Default |
---|---|---|
NO_FILL |
|
|
SOLID_FOREGROUND |
|
|
FINE_DOTS |
|
|
ALT_BARS |
|
|
SPARSE_DOTS |
|
|
THICK_HORZ_BANDS |
|
|
THICK_VERT_BANDS |
|
|
THICK_BACKWARD_DIAG |
|
|
THICK_FORWARD_DIAG |
|
|
BIG_SPOTS |
|
|
BRICKS |
|
|
THIN_HORZ_BANDS |
|
|
THIN_VERT_BANDS |
|
|
THIN_BACKWARD_DIAG |
|
|
THIN_FORWARD_DIAG |
|
|
SQUARES |
|
|
DIAMONDS |
|
|
FONT_UNDERLINE
Underline patterns used in ExcelFont
Properties
Name | Default |
---|---|
DOUBLE |
|
DOUBLE_ACCOUNTING |
|
NONE |
|
SINGLE |
|
SINGLE_ACCOUNTING |
|
INDEXED_COLOR : enum
enum
Colors from the Excel color palette
Properties
Name | Type | Default |
---|---|---|
AQUA |
|
|
BLACK |
|
|
BLUE |
|
|
BLUE_GREY |
|
|
BRIGHT_GREEN |
|
|
BROWN |
|
|
CORAL |
|
|
CORNFLOWER_BLUE |
|
|
DARK_BLUE |
|
|
DARK_GREEN |
|
|
DARK_RED |
|
|
DARK_TEAL |
|
|
DARK_YELLOW |
|
|
GOLD |
|
|
GREEN |
|
|
GREY_25_PERCENT |
|
|
GREY_40_PERCENT |
|
|
GREY_50_PERCENT |
|
|
GREY_80_PERCENT |
|
|
INDIGO |
|
|
LAVENDER |
|
|
LEMON_CHIFFON |
|
|
LIGHT_BLUE |
|
|
LIGHT_CORNFLOWER_BLUE |
|
|
LIGHT_GREEN |
|
|
LIGHT_ORANGE |
|
|
LIGHT_TURQUOISE |
|
|
LIGHT_YELLOW |
|
|
LIME |
|
|
MAROON |
|
|
OLIVE_GREEN |
|
|
ORANGE |
|
|
ORCHID |
|
|
PALE_BLUE |
|
|
PINK |
|
|
PLUM |
|
|
RED |
|
|
ROSE |
|
|
ROYAL_BLUE |
|
|
SEA_GREEN |
|
|
SKY_BLUE |
|
|
TAN |
|
|
TEAL |
|
|
TURQUOISE |
|
|
VIOLET |
|
|
WHITE |
|
|
YELLOW |
|
|
PAPER_SIZE
Possible paper sizes for a PrintSetup
Properties
Name | Default |
---|---|
A3_PAPERSIZE |
|
A4_EXTRA_PAPERSIZE |
|
A4_PAPERSIZE |
|
A4_PLUS_PAPERSIZE |
|
A4_ROTATED_PAPERSIZE |
|
A4_SMALL_PAPERSIZE |
|
A4_TRANSVERSE_PAPERSIZE |
|
A5_PAPERSIZE |
|
B4_PAPERSIZE |
|
B5_PAPERSIZE |
|
ELEVEN_BY_SEVENTEEN_PAPERSIZE |
|
ENVELOPE_10_PAPERSIZE |
|
ENVELOPE_9_PAPERSIZE |
|
ENVELOPE_C3_PAPERSIZE |
|
ENVELOPE_C4_PAPERSIZE |
|
ENVELOPE_C5_PAPERSIZE |
|
ENVELOPE_C6_PAPERSIZE |
|
ENVELOPE_CS_PAPERSIZE |
|
ENVELOPE_DL_PAPERSIZE |
|
ENVELOPE_MONARCH_PAPERSIZE |
|
EXECUTIVE_PAPERSIZE |
|
FOLIO8_PAPERSIZE |
|
LEDGER_PAPERSIZE |
|
LEGAL_PAPERSIZE |
|
LETTER_PAPERSIZE |
|
LETTER_ROTATED_PAPERSIZE |
|
LETTER_SMALL_PAGESIZE |
|
NOTE8_PAPERSIZE |
|
PRINTER_DEFAULT_PAPERSIZE |
|
QUARTO_PAPERSIZE |
|
STATEMENT_PAPERSIZE |
|
TABLOID_PAPERSIZE |
|
TEN_BY_FOURTEEN_PAPERSIZE |
|
SHEET_PANE : enum
enum
Panes of a sheet used in split panes
Properties
Name | Type | Default |
---|---|---|
LOWER_RIGHT |
|
|
LOWER_LEFT |
|
|
UPPER_LEFT |
|
|
UPPER_RIGHT |
|
|
VERTICAL_ALIGNMENT : enum
enum
Vertical alignments used in ExcelCellStyle
Properties
Name | Type | Default |
---|---|---|
BOTTOM |
|
|
CENTER |
|
|
JUSTIFY |
|
|
TOP |
|
|
DISTRIBUTED |
|
|
createPrintSetup() ⇒ PrintSetup
PrintSetup
Creates a PrintSetup object that can be used in ExcelSheet.setPrintSetup() or to set the default print setup used when workbooks are created from FoundSet or DataSet
createWorkbook([templateOrFileType]) ⇒ ExcelWorkbook
ExcelWorkbook
Returns an empty ExcelWorkbook
Param | Type | Description |
---|---|---|
[templateOrFileType] |
| either an existing Excel file as template or one of the FILE_FORMAT constants when creating empty workbooks |
Example
createWorkbookFromDataSet(dataset, [columns], [headers], [templateOrFileType], [sheetNameToUse]) ⇒ DataSetExcelWorkbook
DataSetExcelWorkbook
Creates an ExcelWorkbook from the given dataset
If a template is provided, the dataset will be inserted in the given sheet
Param | Type | Description |
---|---|---|
dataset |
| the dataset |
[columns] |
| the column numbers to be included in the sheet |
[headers] |
| the text to be used as column headers |
[templateOrFileType] |
| either file or media URL pointing to an existing Excel to be used as template or one of the FILE_FORMAT constants when creating empty workbooks |
[sheetNameToUse] |
| when a template is used, this is the name of the sheet to be filled |
createWorkbookFromFoundSet(foundset, dataproviders, [headers], [templateOrFileType], [sheetNameToUse]) ⇒ FoundSetExcelWorkbook
FoundSetExcelWorkbook
Creates an ExcelWorkbook from the given foundset
If a templateOrFileType is provided, the foundset will be inserted in the given sheet
Param | Type | Description |
---|---|---|
foundset |
| the foundset |
dataproviders |
| the dataproviders to be used for the excel sheet |
[headers] |
| the text to be used as column headers |
[templateOrFileType] |
| either file or media URL pointing to an existing Excel to be used as templateOrFileType or one of the FILE_FORMAT constants when creating empty workbooks |
[sheetNameToUse] |
| when a template is used, this is the name of the sheet to be filled |
getCellReferenceFromRange(firstRow, lastRow, firstColumn, lastColumn) ⇒ String
String
Creates a cell reference (e.g. "A4:C92") from the given range
Returns: String
- cellReference
Param | Type |
---|---|
firstRow |
|
lastRow |
|
firstColumn |
|
lastColumn |
|
getRangeFromCellReference(cellReference) ⇒ Object
Object
Converts a cell reference (e.g. "B4:AK234" or "C6") to an object holding first and last row and column
Param | Type |
---|---|
cellReference |
|
getWorkbook(original) ⇒ ExcelWorkbook
ExcelWorkbook
Returns an ExcelWorkbook from the given file or media URL
Param | Type | Description |
---|---|---|
original |
| path to the file, file or media URL |
isLoaded() ⇒ Boolean
Boolean
If true, all required libraries are present and the scope can be used
set()
setDefaultPrintSetup(setup)
Sets the default print setup used when workbooks are created from FoundSet or DataSet
Param | Type |
---|---|
setup |
|
copies : Number
Number
The number of copies
draft : Boolean
Boolean
Whether it is in draft mode
fitHeight : Number
Number
The number of pages high to fit the sheet in
fitWidth : Number
Number
The number of pages high to fit the sheet in
landscape : Boolean
Boolean
Whether to print in landscape
mergedRegionType : Object
Object
noColor : Boolean
Boolean
Whether it is black and white
paperSize : Number
Number
The paper size
Last updated