# Full API Reference

### Classes

[DataSetExcelWorkbook](#datasetexcelworkbook-servoyexcelworkbook) ⇐ [`ServoyExcelWorkbook`](#new_ServoyExcelWorkbook_new)

[ExcelWorkbook](#excelworkbook)

[FoundSetExcelWorkbook](#foundsetexcelworkbook-servoyexcelworkbook) ⇐ [`ServoyExcelWorkbook`](#new_ServoyExcelWorkbook_new)

### Members

[copies](#copies-number) : `Number`

The number of copies

[draft](#draft-boolean) : `Boolean`

Whether it is in draft mode

[fitHeight](#fitheight-number) : `Number`

The number of pages high to fit the sheet in

[fitWidth](#fitwidth-number) : `Number`

The number of pages high to fit the sheet in

[landscape](#landscape-boolean) : `Boolean`

Whether to print in landscape

[mergedRegionType](#mergedregiontype-object) : `Object`

[noColor](#nocolor-boolean) : `Boolean`

Whether it is black and white

[paperSize](#papersize-number) : `Number`

The paper size

### Functions

[createPrintSetup()](#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\])](#createworkbook-templateorfiletype-excelworkbook) ⇒ [`ExcelWorkbook`](#ExcelWorkbook)

Returns an empty ExcelWorkbook

[createWorkbookFromDataSet(dataset, \[columns\], \[headers\], \[templateOrFileType\], \[sheetNameToUse\])](#createworkbookfromdataset-dataset-columns-headers-templateorfiletype-sheetnametouse-datasetexcelwork) ⇒ [`DataSetExcelWorkbook`](#datasetexcelworkbook-servoyexcelworkbook)

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\])](#createworkbookfromfoundset-foundset-dataproviders-headers-templateorfiletype-sheetnametouse-foundset) ⇒ [`FoundSetExcelWorkbook`](#foundsetexcelworkbook-servoyexcelworkbook)

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)](#getcellreferencefromrange-firstrow-lastrow-firstcolumn-lastcolumn-string) ⇒ `String`

Creates a cell reference (e.g. "A4:C92") from the given range

[getRangeFromCellReference(cellReference)](#getrangefromcellreference-cellreference-object) ⇒ `Object`

Converts a cell reference (e.g. "B4:AK234" or "C6") to an object holding first and last row and column

[getWorkbook(original)](#getworkbook-original-excelworkbook) ⇒ [`ExcelWorkbook`](#ExcelWorkbook)

Returns an ExcelWorkbook from the given file or media URL

[isLoaded()](#isloaded-boolean) ⇒ `Boolean`

If true, all required libraries are present and the scope can be used

[set()](#set)

[setDefaultPrintSetup(setup)](#setdefaultprintsetup-setup)

Sets the default print setup used when workbooks are created from FoundSet or DataSet

### DataSetExcelWorkbook ⇐ [`ServoyExcelWorkbook`](#new_ServoyExcelWorkbook_new)

**Extends**: [`ServoyExcelWorkbook`](#new_ServoyExcelWorkbook_new)

* [DataSetExcelWorkbook](#datasetexcelworkbook-servoyexcelworkbook) ⇐ [`ServoyExcelWorkbook`](#new_ServoyExcelWorkbook_new)
  * *inner*
    * [\~dataFilled](#datasetexcelworkbook-datafilled-boolean) : `Boolean`
  * *instance*
    * [.cloneCellStyle(cellStyle)](#datasetexcelworkbook.clonecellstyle-cellstyle-excelcellstyle) ⇒ [`ExcelCellStyle`](#new_ExcelCellStyle_new)
    * [.cloneFont(font)](#datasetexcelworkbook.clonefont-font-excelfont) ⇒ [`ExcelFont`](#new_ExcelFont_new)
    * [.cloneSheet(indexToClone)](#datasetexcelworkbook.clonesheet-indextoclone-excelsheet) ⇒ [`ExcelSheet`](#new_ExcelSheet_new)
    * [.close()](#datasetexcelworkbook.close)
    * [.createCellStyle()](#datasetexcelworkbook.createcellstyle-excelcellstyle) ⇒ [`ExcelCellStyle`](#new_ExcelCellStyle_new)
    * [.createColumnStyle(columnIndex)](#datasetexcelworkbook.createcolumnstyle-columnindex-excelcellstyle) ⇒ [`ExcelCellStyle`](#new_ExcelCellStyle_new)
    * [.createFont()](#datasetexcelworkbook.createfont-excelfont) ⇒ [`ExcelFont`](#new_ExcelFont_new)
    * [.createHeaderStyle()](#datasetexcelworkbook.createheaderstyle-excelcellstyle) ⇒ [`ExcelCellStyle`](#new_ExcelCellStyle_new)
    * [.createRowStyle()](#datasetexcelworkbook.createrowstyle-excelcellstyle) ⇒ [`ExcelCellStyle`](#new_ExcelCellStyle_new)
    * [.createSheet(sheetName)](#datasetexcelworkbook.createsheet-sheetname-excelsheet) ⇒ [`ExcelSheet`](#new_ExcelSheet_new)
    * [.fillData()](#datasetexcelworkbook.filldata)
    * [.getBytes()](#datasetexcelworkbook.getbytes-array-.less-than-byte-greater-than) ⇒ `[ 'Array' ].<byte>`
    * [.getDataSet()](#datasetexcelworkbook.getdataset-jsdataset) ⇒ `JSDataSet`
    * [.getNumberOfSheets()](#datasetexcelworkbook.getnumberofsheets-number) ⇒ `Number`
    * [.getSheet(sheetName)](#datasetexcelworkbook.getsheet-sheetname-excelsheet) ⇒ [`ExcelSheet`](#new_ExcelSheet_new)
    * [.getSheetAt(index)](#datasetexcelworkbook.getsheetat-index-excelsheet) ⇒ [`ExcelSheet`](#new_ExcelSheet_new)
    * [.getSheetNameAt(index)](#datasetexcelworkbook.getsheetnameat-index-string) ⇒ `String`
    * [.getSheetNames()](#datasetexcelworkbook.getsheetnames-array-.less-than-string-greater-than) ⇒ `[ 'Array' ].<String>`
    * [.removeSheetAt(index)](#datasetexcelworkbook.removesheetat-index)
    * [.setFormatForColumn(columnIndex, format)](#datasetexcelworkbook.setformatforcolumn-columnindex-format)
    * [.setSheetNameAt(index, name)](#datasetexcelworkbook.setsheetnameat-index-name)
    * [.writeToFile(targetFile)](#datasetexcelworkbook.writetofile-targetfile-boolean) ⇒ `Boolean`
    * [.autoSizeColumns](#datasetexcelworkbook.autosizecolumns-boolean) : `Boolean`
    * [.columnFormats](#datasetexcelworkbook.columnformats-array-.less-than-string-greater-than) : `[ 'Array' ].<String>`
    * [.columnStyles](#datasetexcelworkbook.columnstyles-array-.less-than-excelcellstyle-greater-than) : [`[ 'Array' ].<ExcelCellStyle>`](#new_ExcelCellStyle_new)
    * [.dataset](#datasetexcelworkbook.dataset-jsdataset) : `JSDataSet`
    * [.defaultDateFormat](#datasetexcelworkbook.defaultdateformat-string) : `String`
    * [.defaultNumberFormat](#datasetexcelworkbook.defaultnumberformat-string) : `String`
    * [.freezeFirstRow](#datasetexcelworkbook.freezefirstrow-boolean) : `Boolean`
    * [.headerStyle](#datasetexcelworkbook.headerstyle-excelcellstyle) : [`ExcelCellStyle`](#new_ExcelCellStyle_new)
    * [.rowStyle](#datasetexcelworkbook.rowstyle-excelcellstyle) : [`ExcelCellStyle`](#new_ExcelCellStyle_new)
    * [.setAutoFilter](#datasetexcelworkbook.setautofilter-boolean) : `Boolean`
    * [.sheet](#datasetexcelworkbook.sheet-excelsheet) : [`ExcelSheet`](#new_ExcelSheet_new)
    * [.sheetName](#datasetexcelworkbook.sheetname-string) : `String`
    * [.startColumn](#datasetexcelworkbook.startcolumn-number) : `Number`
    * [.startRow](#datasetexcelworkbook.startrow-number) : `Number`
    * [.wb](#datasetexcelworkbook.wb-packages.org.apache.poi.ss.usermodel.workbook) : `Packages.org.apache.poi.ss.usermodel.Workbook`
    * [.workbook](#datasetexcelworkbook.workbook-excelworkbook) : [`ExcelWorkbook`](#ExcelWorkbook)
  * [new DataSetExcelWorkbook(dataset, \[columns\], \[headers\], \[templateOrFileType\], \[sheetNameToUse\])](#new-datasetexcelworkbook-dataset-columns-headers-templateorfiletype-sheetnametouse)

#### DataSetExcelWorkbook\~dataFilled : `Boolean`

#### dataSetExcelWorkbook.cloneCellStyle(cellStyle) ⇒ [`ExcelCellStyle`](#new_ExcelCellStyle_new)

Clones the given ExcelCellStyle

| Param     | Type                                        |
| --------- | ------------------------------------------- |
| cellStyle | [`ExcelCellStyle`](#new_ExcelCellStyle_new) |

#### dataSetExcelWorkbook.cloneFont(font) ⇒ [`ExcelFont`](#new_ExcelFont_new)

Clones the given font and returns a new ExcelFont

| Param | Type                              |
| ----- | --------------------------------- |
| font  | [`ExcelFont`](#new_ExcelFont_new) |

#### dataSetExcelWorkbook.cloneSheet(indexToClone) ⇒ [`ExcelSheet`](#new_ExcelSheet_new)

Creates an ExcelSheet from an existing sheet in the Workbook

**Returns**: [`ExcelSheet`](#new_ExcelSheet_new) - clone

| Param        | Type     | Description |
| ------------ | -------- | ----------- |
| indexToClone | `Number` | one based   |

#### dataSetExcelWorkbook.close()

Closes this workbook

#### dataSetExcelWorkbook.createCellStyle() ⇒ [`ExcelCellStyle`](#new_ExcelCellStyle_new)

Creates an empty ExcelCellStyle

#### dataSetExcelWorkbook.createColumnStyle(columnIndex) ⇒ [`ExcelCellStyle`](#new_ExcelCellStyle_new)

Creates and returns an ExcelCellStyle used for a specific column

| Param       | Type     |
| ----------- | -------- |
| columnIndex | `Number` |

#### dataSetExcelWorkbook.createFont() ⇒ [`ExcelFont`](#new_ExcelFont_new)

Creates a font

#### dataSetExcelWorkbook.createHeaderStyle() ⇒ [`ExcelCellStyle`](#new_ExcelCellStyle_new)

Creates and returns an ExcelCellStyle used for the header row

#### dataSetExcelWorkbook.createRowStyle() ⇒ [`ExcelCellStyle`](#new_ExcelCellStyle_new)

Creates and returns an ExcelCellStyle used for a data row

#### dataSetExcelWorkbook.createSheet(sheetName) ⇒ [`ExcelSheet`](#new_ExcelSheet_new)

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 | `String` |

#### dataSetExcelWorkbook.fillData()

Fills the sheet with the data of the foundset

This is automatically done when `writeToFile()` or `getBytes()` is called

**Overrides**: [`fillData`](#ServoyExcelWorkbook+fillData)

#### dataSetExcelWorkbook.getBytes() ⇒ `[ 'Array' ].<byte>`

Returns the data of this workbook as a byte\[]

**Returns**: `[ 'Array' ].<byte>` - bytes

#### dataSetExcelWorkbook.getDataSet() ⇒ `JSDataSet`

Returns the dataset used to create this workbook

#### dataSetExcelWorkbook.getNumberOfSheets() ⇒ `Number`

Returns the number of spreadsheets in the workbook

#### dataSetExcelWorkbook.getSheet(sheetName) ⇒ [`ExcelSheet`](#new_ExcelSheet_new)

Returns the sheet with the given name (case insensitive match)

| Param     | Type     |
| --------- | -------- |
| sheetName | `String` |

#### dataSetExcelWorkbook.getSheetAt(index) ⇒ [`ExcelSheet`](#new_ExcelSheet_new)

Returns the ExcelSheet object at the given index

| Param | Type     |
| ----- | -------- |
| index | `Number` |

#### dataSetExcelWorkbook.getSheetNameAt(index) ⇒ `String`

Returns the name of the sheet at the given index

**Returns**: `String` - sheetName

| Param | Type     |
| ----- | -------- |
| index | `Number` |

#### dataSetExcelWorkbook.getSheetNames() ⇒ `[ 'Array' ].<String>`

Returns all sheet names

#### dataSetExcelWorkbook.removeSheetAt(index)

Removes the sheet at the given index

| Param | Type     |
| ----- | -------- |
| index | `Number` |

#### dataSetExcelWorkbook.setFormatForColumn(columnIndex, format)

Sets a date or number format used for the given column

| Param       | Type     |
| ----------- | -------- |
| columnIndex | `Number` |
| format      | `String` |

#### dataSetExcelWorkbook.setSheetNameAt(index, name)

Sets the sheet name

| Param | Type     |
| ----- | -------- |
| index | `Number` |
| name  | `String` |

#### dataSetExcelWorkbook.writeToFile(targetFile) ⇒ `Boolean`

Writes this workbook to the given file

**Returns**: `Boolean` - success

| Param      | Type                              |
| ---------- | --------------------------------- |
| targetFile | `String` \| `plugins.file.JSFile` |

#### dataSetExcelWorkbook.autoSizeColumns : `Boolean`

Whether or not all data columns should be auto sized

#### dataSetExcelWorkbook.columnFormats : `[ 'Array' ].<String>`

#### dataSetExcelWorkbook.columnStyles : [`[ 'Array' ].<ExcelCellStyle>`](#new_ExcelCellStyle_new)

#### dataSetExcelWorkbook.dataset : `JSDataSet`

The dataset used to create this workbook

#### dataSetExcelWorkbook.defaultDateFormat : `String`

The default format used to format date values

This can be overriden for specific columns by calling `setFormatForColumn()`

#### dataSetExcelWorkbook.defaultNumberFormat : `String`

The default format used to format number values

This can be overriden for specific columns by calling `setFormatForColumn()`

#### dataSetExcelWorkbook.freezeFirstRow : `Boolean`

Whether the header row is frozen or not

**Overrides**: [`freezeFirstRow`](#ServoyExcelWorkbook+freezeFirstRow)

#### dataSetExcelWorkbook.headerStyle : [`ExcelCellStyle`](#new_ExcelCellStyle_new)

The style used for the header of the data

**Overrides**: [`headerStyle`](#ServoyExcelWorkbook+headerStyle)

#### dataSetExcelWorkbook.rowStyle : [`ExcelCellStyle`](#new_ExcelCellStyle_new)

The style used for a data cell

**Overrides**: [`rowStyle`](#ServoyExcelWorkbook+rowStyle)

#### dataSetExcelWorkbook.setAutoFilter : `Boolean`

Whether or not the data columns should be auto filtered or not

**Overrides**: [`setAutoFilter`](#ServoyExcelWorkbook+setAutoFilter)

#### dataSetExcelWorkbook.sheet : [`ExcelSheet`](#new_ExcelSheet_new)

The ExcelSheet used or created

#### dataSetExcelWorkbook.sheetName : `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`

The first column where data will be inserted (one based)

#### dataSetExcelWorkbook.startRow : `Number`

The first row where data will be inserted (one based)

#### dataSetExcelWorkbook.wb : `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               | `JSDataSet`                                   | the dataset                                                                                                                                      |
| \[columns]            | `[ 'Array' ].<Number>`                        | the column numbers to be included in the sheet                                                                                                   |
| \[headers]            | `[ 'Array' ].<String>`                        | the text to be used as column headers                                                                                                            |
| \[templateOrFileType] | `String` \| `plugins.file.JSFile` \| `Number` | 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]     | `String`                                      | when a template is used, this is the name of the sheet to be filled                                                                              |

**Example**

```js
var query = datasources.db.example_data.orders.createSelect();
query.result.add(query.columns.customerid);	
query.result.add(query.columns.shipname);
query.result.add(query.columns.shipaddress);
query.result.add(query.columns.shipcity);
query.result.add(query.columns.shipcountry);
query.result.add(query.columns.shippeddate);
query.result.add(query.columns.freight);	
var dataset = databaseManager.getDataSetByQuery(query, -1);

var wb = scopes.svyExcelUtils.createWorkbookFromDataSet(dataset, [2,3,4,5,6,7], ["Company", "Address", "City", "Country", "Order date", "Freight"]);

wb.setFormatForColumn(5, "yyyy-MM-dd");
wb.setFormatForColumn(6, "#,##0.00");
wb.sheetName = "Dataset export";
wb.autoSizeColumns = true;
wb.freezeFirstRow = true;
wb.setAutoFilter = true;

var headerStyle = wb.createHeaderStyle();
headerStyle.setFont("Calibri,1,12");
headerStyle.setFillForegroundColor(scopes.svyExcelUtils.INDEXED_COLOR.LIGHT_CORNFLOWER_BLUE);
headerStyle.setFillPattern(scopes.svyExcelUtils.FILL_PATTERN.SOLID_FOREGROUND);

wb.writeToFile("d:\\dataset.xls");
```

***

### ExcelWorkbook

**Suppresswarnings(deprecated)**: needs to be added to prevent warnings from deprecated WorkbookFactory.create(Object)

* [ExcelWorkbook](#excelworkbook)
  * [.cloneCellStyle(cellStyle)](#excelworkbook.clonecellstyle-cellstyle-excelcellstyle) ⇒ [`ExcelCellStyle`](#new_ExcelCellStyle_new)
  * [.cloneFont(font)](#excelworkbook.clonefont-font-excelfont) ⇒ [`ExcelFont`](#new_ExcelFont_new)
  * [.cloneSheet(indexToClone)](#excelworkbook.clonesheet-indextoclone-excelsheet) ⇒ [`ExcelSheet`](#new_ExcelSheet_new)
  * [.close()](#excelworkbook.close)
  * [.createCellStyle()](#excelworkbook.createcellstyle-excelcellstyle) ⇒ [`ExcelCellStyle`](#new_ExcelCellStyle_new)
  * [.createFont()](#excelworkbook.createfont-excelfont) ⇒ [`ExcelFont`](#new_ExcelFont_new)
  * [.createSheet(sheetName)](#excelworkbook.createsheet-sheetname-excelsheet) ⇒ [`ExcelSheet`](#new_ExcelSheet_new)
  * [.getBytes()](#excelworkbook.getbytes-array-.less-than-byte-greater-than) ⇒ `[ 'Array' ].<byte>`
  * [.getNumberOfSheets()](#excelworkbook.getnumberofsheets-number) ⇒ `Number`
  * [.getSheet(sheetName)](#excelworkbook.getsheet-sheetname-excelsheet) ⇒ [`ExcelSheet`](#new_ExcelSheet_new)
  * [.getSheetAt(index)](#excelworkbook.getsheetat-index-excelsheet) ⇒ [`ExcelSheet`](#new_ExcelSheet_new)
  * [.getSheetNameAt(index)](#excelworkbook.getsheetnameat-index-string) ⇒ `String`
  * [.getSheetNames()](#excelworkbook.getsheetnames-array-.less-than-string-greater-than) ⇒ `[ 'Array' ].<String>`
  * [.removeSheetAt(index)](#excelworkbook.removesheetat-index)
  * [.setSheetNameAt(index, name)](#excelworkbook.setsheetnameat-index-name)
  * [.writeToFile(targetFile)](#excelworkbook.writetofile-targetfile-boolean) ⇒ `Boolean`
  * [.wb](#excelworkbook.wb-packages.org.apache.poi.ss.usermodel.workbook) : `Packages.org.apache.poi.ss.usermodel.Workbook`
  * [new ExcelWorkbook(\[templateOrFileType\])](#new-excelworkbook-templateorfiletype)

#### excelWorkbook.cloneCellStyle(cellStyle) ⇒ [`ExcelCellStyle`](#new_ExcelCellStyle_new)

Clones the given ExcelCellStyle

| Param     | Type                                        |
| --------- | ------------------------------------------- |
| cellStyle | [`ExcelCellStyle`](#new_ExcelCellStyle_new) |

#### excelWorkbook.cloneFont(font) ⇒ [`ExcelFont`](#new_ExcelFont_new)

Clones the given font and returns a new ExcelFont

| Param | Type                              |
| ----- | --------------------------------- |
| font  | [`ExcelFont`](#new_ExcelFont_new) |

#### excelWorkbook.cloneSheet(indexToClone) ⇒ [`ExcelSheet`](#new_ExcelSheet_new)

Creates an ExcelSheet from an existing sheet in the Workbook

**Returns**: [`ExcelSheet`](#new_ExcelSheet_new) - clone

| Param        | Type     | Description |
| ------------ | -------- | ----------- |
| indexToClone | `Number` | one based   |

#### excelWorkbook.close()

Closes this workbook

#### excelWorkbook.createCellStyle() ⇒ [`ExcelCellStyle`](#new_ExcelCellStyle_new)

Creates an empty ExcelCellStyle

#### excelWorkbook.createFont() ⇒ [`ExcelFont`](#new_ExcelFont_new)

Creates a font

#### excelWorkbook.createSheet(sheetName) ⇒ [`ExcelSheet`](#new_ExcelSheet_new)

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 | `String` |

#### excelWorkbook.getBytes() ⇒ `[ 'Array' ].<byte>`

Returns this workbook as a byte\[] array

#### excelWorkbook.getNumberOfSheets() ⇒ `Number`

Returns the number of spreadsheets in the workbook

#### excelWorkbook.getSheet(sheetName) ⇒ [`ExcelSheet`](#new_ExcelSheet_new)

Returns the sheet with the given name (case insensitive match)

| Param     | Type     |
| --------- | -------- |
| sheetName | `String` |

#### excelWorkbook.getSheetAt(index) ⇒ [`ExcelSheet`](#new_ExcelSheet_new)

Returns the ExcelSheet object at the given index

| Param | Type     |
| ----- | -------- |
| index | `Number` |

#### excelWorkbook.getSheetNameAt(index) ⇒ `String`

Returns the name of the sheet at the given index

**Returns**: `String` - sheetName

| Param | Type     |
| ----- | -------- |
| index | `Number` |

#### excelWorkbook.getSheetNames() ⇒ `[ 'Array' ].<String>`

Returns all sheet names

#### excelWorkbook.removeSheetAt(index)

Removes the sheet at the given index

| Param | Type     |
| ----- | -------- |
| index | `Number` |

***

#### excelWorkbook.setSheetNameAt(index, name)

Sets the sheet name

| Param | Type     |
| ----- | -------- |
| index | `Number` |
| name  | `String` |

***

#### excelWorkbook.writeToFile(targetFile) ⇒ `Boolean`

Writes this workbook to the given targetFile

**Returns**: `Boolean` - success

| Param      | Type                              |
| ---------- | --------------------------------- |
| targetFile | `plugins.file.JSFile` \| `String` |

***

#### excelWorkbook.wb : `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] | `String` \| `plugins.file.JSFile` \| `Number` \| `Array.<byte>` | either a path, mediaUrl, JSFile or byte\[] when reading an existing workbook or one of the FILE\_FORMAT constants when creating empty workbooks |

**Example**

```js
// Create workbook and sheet
var workbook = new scopes.svyExcelUtils.Workbook(scopes.svyExcelUtils.FILE_FORMAT.XLSX);
var sheet = workbook.createSheet("Test");

// Create style for the header
var headerStyle = workbook.createCellStyle();
headerStyle
   .setFont("Arial,1,12")
   .setFillPattern(scopes.svyExcelUtils.FILL_PATTERN.SOLID_FOREGROUND)
   .setFillForegroundColor(scopes.svyExcelUtils.INDEXED_COLOR.LIGHT_ORANGE)
   .setAlignment(scopes.svyExcelUtils.ALIGNMENT.CENTER);

var rowNum = 1;

// Create header row and cells
var row = sheet.createRow(rowNum ++);
var cell = row.createCell(1);
cell.setCellValue("Test 1", headerStyle);

cell = row.createCell(2);
cell.setCellValue("Test 2", headerStyle);

// Create some data and write to the sheet
var data = [[10, 35], [15, 47], [9, 22], [10, 33]];
for (var i = 0; i < data.length; i++) {
   row = sheet.createRow(rowNum ++);
   row.createCell(1).setCellValue(data[i][0]);
   row.createCell(2).setCellValue(data[i][1]);
}

// Create a style for the sum
var sumStyle = workbook.createCellStyle();
// Clone the default font, so we won't be changing the default
var font = sumStyle.cloneFont();
font.underline = scopes.svyExcelUtils.FONT_UNDERLINE.DOUBLE_ACCOUNTING;
font.isBold = true;

// Create formula cells at the bottom
row = sheet.createRow(rowNum ++);
cell = row.createCell(1);
cell.setCellStyle(sumStyle);
cell.setCellFormula("SUM(" + scopes.svyExcelUtils.getCellReferenceFromRange(2, 1 + data.length, 1, 1) + ")");

cell = row.createCell(2);
cell.setCellStyle(sumStyle);
cell.setCellFormula("SUM(" + scopes.svyExcelUtils.getCellReferenceFromRange(2, 1 + data.length, 2, 2) + ")");

// Write to file
var success = workbook.writeToFile("d:\\test.xls");
```

***

### FoundSetExcelWorkbook ⇐ [`ServoyExcelWorkbook`](#new_ServoyExcelWorkbook_new)

**Extends**: [`ServoyExcelWorkbook`](#new_ServoyExcelWorkbook_new)

* [FoundSetExcelWorkbook](#foundsetexcelworkbook-servoyexcelworkbook) ⇐ [`ServoyExcelWorkbook`](#new_ServoyExcelWorkbook_new)
  * *inner*
    * [\~dataFilled](#foundsetexcelworkbook-datafilled-boolean) : `Boolean`
  * *instance*
    * [.cloneCellStyle(cellStyle)](#foundsetexcelworkbook.clonecellstyle-cellstyle-excelcellstyle) ⇒ [`ExcelCellStyle`](#new_ExcelCellStyle_new)
    * [.cloneFont(font)](#foundsetexcelworkbook.clonefont-font-excelfont) ⇒ [`ExcelFont`](#new_ExcelFont_new)
    * [.cloneSheet(indexToClone)](#foundsetexcelworkbook.clonesheet-indextoclone-excelsheet) ⇒ [`ExcelSheet`](#new_ExcelSheet_new)
    * [.close()](#foundsetexcelworkbook.close)
    * [.createCellStyle()](#foundsetexcelworkbook.createcellstyle-excelcellstyle) ⇒ [`ExcelCellStyle`](#new_ExcelCellStyle_new)
    * [.createColumnStyle(columnIndex)](#foundsetexcelworkbook.createcolumnstyle-columnindex-excelcellstyle) ⇒ [`ExcelCellStyle`](#new_ExcelCellStyle_new)
    * [.createFont()](#foundsetexcelworkbook.createfont-excelfont) ⇒ [`ExcelFont`](#new_ExcelFont_new)
    * [.createHeaderStyle()](#foundsetexcelworkbook.createheaderstyle-excelcellstyle) ⇒ [`ExcelCellStyle`](#new_ExcelCellStyle_new)
    * [.createRowStyle()](#foundsetexcelworkbook.createrowstyle-excelcellstyle) ⇒ [`ExcelCellStyle`](#new_ExcelCellStyle_new)
    * [.createSheet(sheetName)](#foundsetexcelworkbook.createsheet-sheetname-excelsheet) ⇒ [`ExcelSheet`](#new_ExcelSheet_new)
    * [.fillData()](#foundsetexcelworkbook.filldata)
    * [.getBytes()](#foundsetexcelworkbook.getbytes-array-.less-than-byte-greater-than) ⇒ `[ 'Array' ].<byte>`
    * [.getFoundSet()](#foundsetexcelworkbook.getfoundset-jsfoundset) ⇒ `JSFoundSet`
    * [.getNumberOfSheets()](#foundsetexcelworkbook.getnumberofsheets-number) ⇒ `Number`
    * [.getSheet(sheetName)](#foundsetexcelworkbook.getsheet-sheetname-excelsheet) ⇒ [`ExcelSheet`](#new_ExcelSheet_new)
    * [.getSheetAt(index)](#foundsetexcelworkbook.getsheetat-index-excelsheet) ⇒ [`ExcelSheet`](#new_ExcelSheet_new)
    * [.getSheetNameAt(index)](#foundsetexcelworkbook.getsheetnameat-index-string) ⇒ `String`
    * [.getSheetNames()](#foundsetexcelworkbook.getsheetnames-array-.less-than-string-greater-than) ⇒ `[ 'Array' ].<String>`
    * [.removeSheetAt(index)](#foundsetexcelworkbook.removesheetat-index)
    * [.setFormatForColumn(columnIndex, format)](#foundsetexcelworkbook.setformatforcolumn-columnindex-format)
    * [.setSheetNameAt(index, name)](#foundsetexcelworkbook.setsheetnameat-index-name)
    * [.writeToFile(targetFile)](#foundsetexcelworkbook.writetofile-targetfile-boolean) ⇒ `Boolean`
    * [.autoSizeColumns](#foundsetexcelworkbook.autosizecolumns-boolean) : `Boolean`
    * [.columnFormats](#foundsetexcelworkbook.columnformats-array-.less-than-string-greater-than) : `[ 'Array' ].<String>`
    * [.columnStyles](#foundsetexcelworkbook.columnstyles-array-.less-than-excelcellstyle-greater-than) : [`[ 'Array' ].<ExcelCellStyle>`](#new_ExcelCellStyle_new)
    * [.defaultDateFormat](#foundsetexcelworkbook.defaultdateformat-string) : `String`
    * [.defaultNumberFormat](#foundsetexcelworkbook.defaultnumberformat-string) : `String`
    * [.foundset](#foundsetexcelworkbook.foundset-jsfoundset) : `JSFoundSet`
    * [.freezeFirstRow](#foundsetexcelworkbook.freezefirstrow-boolean) : `Boolean`
    * [.headerStyle](#foundsetexcelworkbook.headerstyle-excelcellstyle) : [`ExcelCellStyle`](#new_ExcelCellStyle_new)
    * [.rowStyle](#foundsetexcelworkbook.rowstyle-excelcellstyle) : [`ExcelCellStyle`](#new_ExcelCellStyle_new)
    * [.setAutoFilter](#foundsetexcelworkbook.setautofilter-boolean) : `Boolean`
    * [.sheet](#foundsetexcelworkbook.sheet-excelsheet) : [`ExcelSheet`](#new_ExcelSheet_new)
    * [.sheetName](#foundsetexcelworkbook.sheetname-string) : `String`
    * [.startColumn](#foundsetexcelworkbook.startcolumn-number) : `Number`
    * [.startRow](#foundsetexcelworkbook.startrow-number) : `Number`
    * [.wb](#foundsetexcelworkbook.wb-packages.org.apache.poi.ss.usermodel.workbook) : `Packages.org.apache.poi.ss.usermodel.Workbook`
    * [.workbook](#foundsetexcelworkbook.workbook-excelworkbook) : [`ExcelWorkbook`](#excelworkbook)
  * [new FoundSetExcelWorkbook(foundset, dataproviders, \[headers\], \[templateOrFileType\], \[sheetNameToUse\]](#new-foundsetexcelworkbook-foundset-dataproviders-headers-templateorfiletype-sheetnametouse)

#### FoundSetExcelWorkbook\~dataFilled : `Boolean`

#### foundSetExcelWorkbook.cloneCellStyle(cellStyle) ⇒ [`ExcelCellStyle`](#new_ExcelCellStyle_new)

Clones the given ExcelCellStyle

| Param     | Type                                        |
| --------- | ------------------------------------------- |
| cellStyle | [`ExcelCellStyle`](#new_ExcelCellStyle_new) |

#### foundSetExcelWorkbook.cloneFont(font) ⇒ [`ExcelFont`](#new_ExcelFont_new)

Clones the given font and returns a new ExcelFont

| Param | Type                              |
| ----- | --------------------------------- |
| font  | [`ExcelFont`](#new_ExcelFont_new) |

#### foundSetExcelWorkbook.cloneSheet(indexToClone) ⇒ [`ExcelSheet`](#new_ExcelSheet_new)

Creates an ExcelSheet from an existing sheet in the Workbook

**Returns**: [`ExcelSheet`](#new_ExcelSheet_new) - clone

| Param        | Type     | Description |
| ------------ | -------- | ----------- |
| indexToClone | `Number` | one based   |

#### foundSetExcelWorkbook.close()

Closes this workbook

#### foundSetExcelWorkbook.createCellStyle() ⇒ [`ExcelCellStyle`](#new_ExcelCellStyle_new)

Creates an empty ExcelCellStyle

#### foundSetExcelWorkbook.createColumnStyle(columnIndex) ⇒ [`ExcelCellStyle`](#new_ExcelCellStyle_new)

Creates and returns an ExcelCellStyle used for a specific column

| Param       | Type     |
| ----------- | -------- |
| columnIndex | `Number` |

#### foundSetExcelWorkbook.createFont() ⇒ [`ExcelFont`](#new_ExcelFont_new)

Creates a font

#### foundSetExcelWorkbook.createHeaderStyle() ⇒ [`ExcelCellStyle`](#new_ExcelCellStyle_new)

Creates and returns an ExcelCellStyle used for the header row

#### foundSetExcelWorkbook.createRowStyle() ⇒ [`ExcelCellStyle`](#new_ExcelCellStyle_new)

Creates and returns an ExcelCellStyle used for a data row

#### foundSetExcelWorkbook.createSheet(sheetName) ⇒ [`ExcelSheet`](#new_ExcelSheet_new)

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 | `String` |

#### foundSetExcelWorkbook.fillData()

Fills the sheet with the data of the foundset

This is automatically done when `writeToFile()` or `getBytes()` is called

**Overrides**: [`fillData`](#ServoyExcelWorkbook+fillData)

#### foundSetExcelWorkbook.getBytes() ⇒ `[ 'Array' ].<byte>`

Returns the data of this workbook as a byte\[]

**Returns**: `[ 'Array' ].<byte>` - bytes

#### foundSetExcelWorkbook.getFoundSet() ⇒ `JSFoundSet`

Returns the foundset used to create this workbook

#### foundSetExcelWorkbook.getNumberOfSheets() ⇒ `Number`

Returns the number of spreadsheets in the workbook

#### foundSetExcelWorkbook.getSheet(sheetName) ⇒ [`ExcelSheet`](#new_ExcelSheet_new)

Returns the sheet with the given name (case insensitive match)

| Param     | Type     |
| --------- | -------- |
| sheetName | `String` |

#### foundSetExcelWorkbook.getSheetAt(index) ⇒ [`ExcelSheet`](#new_ExcelSheet_new)

Returns the ExcelSheet object at the given index

| Param | Type     |
| ----- | -------- |
| index | `Number` |

#### foundSetExcelWorkbook.getSheetNameAt(index) ⇒ `String`

Returns the name of the sheet at the given index

**Returns**: `String` - sheetName

| Param | Type     |
| ----- | -------- |
| index | `Number` |

#### foundSetExcelWorkbook.getSheetNames() ⇒ `[ 'Array' ].<String>`

Returns all sheet names

#### foundSetExcelWorkbook.removeSheetAt(index)

Removes the sheet at the given index

| Param | Type     |
| ----- | -------- |
| index | `Number` |

#### foundSetExcelWorkbook.setFormatForColumn(columnIndex, format)

Sets a date or number format used for the given column

| Param       | Type     |
| ----------- | -------- |
| columnIndex | `Number` |
| format      | `String` |

#### foundSetExcelWorkbook.setSheetNameAt(index, name)

Sets the sheet name

| Param | Type     |
| ----- | -------- |
| index | `Number` |
| name  | `String` |

#### foundSetExcelWorkbook.writeToFile(targetFile) ⇒ `Boolean`

Writes this workbook to the given file

**Returns**: `Boolean` - success

| Param      | Type                              |
| ---------- | --------------------------------- |
| targetFile | `String` \| `plugins.file.JSFile` |

#### foundSetExcelWorkbook.autoSizeColumns : `Boolean`

Whether or not all data columns should be auto sized

#### foundSetExcelWorkbook.columnFormats : `[ 'Array' ].<String>`

#### foundSetExcelWorkbook.columnStyles : [`[ 'Array' ].<ExcelCellStyle>`](#new_ExcelCellStyle_new)

#### foundSetExcelWorkbook.defaultDateFormat : `String`

The default format used to format date values

This can be overriden for specific columns by calling `setFormatForColumn()`

#### foundSetExcelWorkbook.defaultNumberFormat : `String`

The default format used to format number values

This can be overriden for specific columns by calling `setFormatForColumn()`

#### foundSetExcelWorkbook.foundset : `JSFoundSet`

The foundset used to create this workbook

#### foundSetExcelWorkbook.freezeFirstRow : `Boolean`

Whether the header row is frozen or not

**Overrides**: [`freezeFirstRow`](#ServoyExcelWorkbook+freezeFirstRow)

#### foundSetExcelWorkbook.headerStyle : [`ExcelCellStyle`](#new_ExcelCellStyle_new)

The style used for the header of the data

**Overrides**: [`headerStyle`](#ServoyExcelWorkbook+headerStyle)

#### foundSetExcelWorkbook.rowStyle : [`ExcelCellStyle`](#new_ExcelCellStyle_new)

The style used for a data cell

**Overrides**: [`rowStyle`](#ServoyExcelWorkbook+rowStyle)

#### foundSetExcelWorkbook.setAutoFilter : `Boolean`

Whether or not the data columns should be auto filtered or not

**Overrides**: [`setAutoFilter`](#ServoyExcelWorkbook+setAutoFilter)

#### foundSetExcelWorkbook.sheet : [`ExcelSheet`](#new_ExcelSheet_new)

The ExcelSheet used or created

#### foundSetExcelWorkbook.sheetName : `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`

The first column where data will be inserted (one based)

#### foundSetExcelWorkbook.startRow : `Number`

The first row where data will be inserted (one based)

#### foundSetExcelWorkbook.wb : `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              | `JSFoundSet`                                  | the foundset                                                                                                                                     |
| dataproviders         | `[ 'Array' ].<String>`                        | the dataproviders to be used for the excel sheet                                                                                                 |
| \[headers]            | `[ 'Array' ].<String>`                        | the text to be used as column headers                                                                                                            |
| \[templateOrFileType] | `String` \| `plugins.file.JSFile` \| `Number` | 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]     | `String`                                      | when a template is used, this is the name of the sheet to be filled                                                                              |

***

### ALIGNMENT : `enum`

Horizontal alignments used in ExcelCellStyle

**Properties**

| Name              | Type                                                       | Default                                                                     |
| ----------------- | ---------------------------------------------------------- | --------------------------------------------------------------------------- |
| CENTER            | `Packages.org.apache.poi.ss.usermodel.HorizontalAlignment` | `Packages.org.apache.poi.ss.usermodel.HorizontalAlignment.CENTER`           |
| CENTER\_SELECTION | `Packages.org.apache.poi.ss.usermodel.HorizontalAlignment` | `Packages.org.apache.poi.ss.usermodel.HorizontalAlignment.CENTER_SELECTION` |
| FILL              | `Packages.org.apache.poi.ss.usermodel.HorizontalAlignment` | `Packages.org.apache.poi.ss.usermodel.HorizontalAlignment.FILL`             |
| GENERAL           | `Packages.org.apache.poi.ss.usermodel.HorizontalAlignment` | `Packages.org.apache.poi.ss.usermodel.HorizontalAlignment.GENERAL`          |
| JUSTIFY           | `Packages.org.apache.poi.ss.usermodel.HorizontalAlignment` | `Packages.org.apache.poi.ss.usermodel.HorizontalAlignment.JUSTIFY`          |
| LEFT              | `Packages.org.apache.poi.ss.usermodel.HorizontalAlignment` | `Packages.org.apache.poi.ss.usermodel.HorizontalAlignment.LEFT`             |
| RIGHT             | `Packages.org.apache.poi.ss.usermodel.HorizontalAlignment` | `Packages.org.apache.poi.ss.usermodel.HorizontalAlignment.RIGHT`            |
| DISTRIBUTED       | `Packages.org.apache.poi.ss.usermodel.HorizontalAlignment` | `Packages.org.apache.poi.ss.usermodel.HorizontalAlignment.DISTRIBUTED`      |

***

### BORDER : `enum`

Borders used in ExcelCellStyle

**Properties**

| Name                   | Type                                               | Default                                                                |
| ---------------------- | -------------------------------------------------- | ---------------------------------------------------------------------- |
| DASH\_DOT              | `Packages.org.apache.poi.ss.usermodel.BorderStyle` | `Packages.org.apache.poi.ss.usermodel.BorderStyle.DASH_DOT`            |
| DASH\_DOT\_DOT         | `Packages.org.apache.poi.ss.usermodel.BorderStyle` | `Packages.org.apache.poi.ss.usermodel.BorderStyle.DASH_DOT_DOT`        |
| DASHED                 | `Packages.org.apache.poi.ss.usermodel.BorderStyle` | `Packages.org.apache.poi.ss.usermodel.BorderStyle.DASHED`              |
| DOTTED                 | `Packages.org.apache.poi.ss.usermodel.BorderStyle` | `Packages.org.apache.poi.ss.usermodel.BorderStyle.DOTTED`              |
| DOUBLE                 | `Packages.org.apache.poi.ss.usermodel.BorderStyle` | `Packages.org.apache.poi.ss.usermodel.BorderStyle.DOUBLE`              |
| HAIR                   | `Packages.org.apache.poi.ss.usermodel.BorderStyle` | `Packages.org.apache.poi.ss.usermodel.BorderStyle.HAIR`                |
| MEDIUM                 | `Packages.org.apache.poi.ss.usermodel.BorderStyle` | `Packages.org.apache.poi.ss.usermodel.BorderStyle.MEDIUM`              |
| MEDIUM\_DASH\_DOT      | `Packages.org.apache.poi.ss.usermodel.BorderStyle` | `Packages.org.apache.poi.ss.usermodel.BorderStyle.MEDIUM_DASH_DOT`     |
| MEDIUM\_DASH\_DOT\_DOT | `Packages.org.apache.poi.ss.usermodel.BorderStyle` | `Packages.org.apache.poi.ss.usermodel.BorderStyle.MEDIUM_DASH_DOT_DOT` |
| MEDIUM\_DASHED         | `Packages.org.apache.poi.ss.usermodel.BorderStyle` | `Packages.org.apache.poi.ss.usermodel.BorderStyle.MEDIUM_DASHED`       |
| NONE                   | `Packages.org.apache.poi.ss.usermodel.BorderStyle` | `Packages.org.apache.poi.ss.usermodel.BorderStyle.NONE`                |
| SLANTED\_DASH\_DOT     | `Packages.org.apache.poi.ss.usermodel.BorderStyle` | `Packages.org.apache.poi.ss.usermodel.BorderStyle.SLANTED_DASH_DOT`    |
| THICK                  | `Packages.org.apache.poi.ss.usermodel.BorderStyle` | `Packages.org.apache.poi.ss.usermodel.BorderStyle.THICK`               |
| THIN                   | `Packages.org.apache.poi.ss.usermodel.BorderStyle` | `Packages.org.apache.poi.ss.usermodel.BorderStyle.THIN`                |

***

### CELL\_TYPE

Possible cell types

**Properties**

| Name    | Default                                                 |
| ------- | ------------------------------------------------------- |
| BLANK   | `Packages.org.apache.poi.ss.usermodel.CellType.BLANK`   |
| BOOLEAN | `Packages.org.apache.poi.ss.usermodel.CellType.BOOLEAN` |
| ERROR   | `Packages.org.apache.poi.ss.usermodel.CellType.ERROR`   |
| FORMULA | `Packages.org.apache.poi.ss.usermodel.CellType.FORMULA` |
| NUMERIC | `Packages.org.apache.poi.ss.usermodel.CellType.NUMERIC` |
| STRING  | `Packages.org.apache.poi.ss.usermodel.CellType.STRING`  |

***

### FILE\_FORMAT

Possible file formats used instead of templates when creating empty workbooks

**Properties**

| Name  | Default | Description                                                                                                             |
| ----- | ------- | ----------------------------------------------------------------------------------------------------------------------- |
| XLS   | `1`     | XLS format                                                                                                              |
| XLSX  | `2`     | XLSX format, requires additional libraries @see [Excel Utils](/reference/servoyextensions/modules/home-7/excelutils.md) |
| SXLSX | `4`     | Streaming version of the XLSX format to avoid out of memory errors                                                      |

***

### FILL\_PATTERN : `enum`

Fill patterns used in ExcelCellStyle

**Properties**

| Name                  | Type                                                   | Default                                                                    |
| --------------------- | ------------------------------------------------------ | -------------------------------------------------------------------------- |
| NO\_FILL              | `Packages.org.apache.poi.ss.usermodel.FillPatternType` | `Packages.org.apache.poi.ss.usermodel.FillPatternType.NO_FILL`             |
| SOLID\_FOREGROUND     | `Packages.org.apache.poi.ss.usermodel.FillPatternType` | `Packages.org.apache.poi.ss.usermodel.FillPatternType.SOLID_FOREGROUND`    |
| FINE\_DOTS            | `Packages.org.apache.poi.ss.usermodel.FillPatternType` | `Packages.org.apache.poi.ss.usermodel.FillPatternType.FINE_DOTS`           |
| ALT\_BARS             | `Packages.org.apache.poi.ss.usermodel.FillPatternType` | `Packages.org.apache.poi.ss.usermodel.FillPatternType.ALT_BARS`            |
| SPARSE\_DOTS          | `Packages.org.apache.poi.ss.usermodel.FillPatternType` | `Packages.org.apache.poi.ss.usermodel.FillPatternType.SPARSE_DOTS`         |
| THICK\_HORZ\_BANDS    | `Packages.org.apache.poi.ss.usermodel.FillPatternType` | `Packages.org.apache.poi.ss.usermodel.FillPatternType.THICK_HORZ_BANDS`    |
| THICK\_VERT\_BANDS    | `Packages.org.apache.poi.ss.usermodel.FillPatternType` | `Packages.org.apache.poi.ss.usermodel.FillPatternType.THICK_VERT_BANDS`    |
| THICK\_BACKWARD\_DIAG | `Packages.org.apache.poi.ss.usermodel.FillPatternType` | `Packages.org.apache.poi.ss.usermodel.FillPatternType.THICK_BACKWARD_DIAG` |
| THICK\_FORWARD\_DIAG  | `Packages.org.apache.poi.ss.usermodel.FillPatternType` | `Packages.org.apache.poi.ss.usermodel.FillPatternType.THICK_FORWARD_DIAG`  |
| BIG\_SPOTS            | `Packages.org.apache.poi.ss.usermodel.FillPatternType` | `Packages.org.apache.poi.ss.usermodel.FillPatternType.BIG_SPOTS`           |
| BRICKS                | `Packages.org.apache.poi.ss.usermodel.FillPatternType` | `Packages.org.apache.poi.ss.usermodel.FillPatternType.BRICKS`              |
| THIN\_HORZ\_BANDS     | `Packages.org.apache.poi.ss.usermodel.FillPatternType` | `Packages.org.apache.poi.ss.usermodel.FillPatternType.THICK_HORZ_BANDS`    |
| THIN\_VERT\_BANDS     | `Packages.org.apache.poi.ss.usermodel.FillPatternType` | `Packages.org.apache.poi.ss.usermodel.FillPatternType.THICK_VERT_BANDS`    |
| THIN\_BACKWARD\_DIAG  | `Packages.org.apache.poi.ss.usermodel.FillPatternType` | `Packages.org.apache.poi.ss.usermodel.FillPatternType.THICK_FORWARD_DIAG`  |
| THIN\_FORWARD\_DIAG   | `Packages.org.apache.poi.ss.usermodel.FillPatternType` | `Packages.org.apache.poi.ss.usermodel.FillPatternType.THICK_FORWARD_DIAG`  |
| SQUARES               | `Packages.org.apache.poi.ss.usermodel.FillPatternType` | `Packages.org.apache.poi.ss.usermodel.FillPatternType.SQUARES`             |
| DIAMONDS              | `Packages.org.apache.poi.ss.usermodel.FillPatternType` | `Packages.org.apache.poi.ss.usermodel.FillPatternType.DIAMONDS`            |

***

### FONT\_UNDERLINE

Underline patterns used in ExcelFont

**Properties**

| Name               | Default                                                               |
| ------------------ | --------------------------------------------------------------------- |
| DOUBLE             | `Packages.org.apache.poi.hssf.usermodel.HSSFFont.U_DOUBLE`            |
| DOUBLE\_ACCOUNTING | `Packages.org.apache.poi.hssf.usermodel.HSSFFont.U_DOUBLE_ACCOUNTING` |
| NONE               | `Packages.org.apache.poi.hssf.usermodel.HSSFFont.U_NONE`              |
| SINGLE             | `Packages.org.apache.poi.hssf.usermodel.HSSFFont.U_SINGLE`            |
| SINGLE\_ACCOUNTING | `Packages.org.apache.poi.hssf.usermodel.HSSFFont.U_SINGLE_ACCOUNTING` |

***

### INDEXED\_COLOR : `enum`

Colors from the Excel color palette

**Properties**

| Name                    | Type                                                 | Default                                                                    |
| ----------------------- | ---------------------------------------------------- | -------------------------------------------------------------------------- |
| AQUA                    | `Packages.org.apache.poi.ss.usermodel.IndexedColors` | `Packages.org.apache.poi.ss.usermodel.IndexedColors.AQUA`                  |
| BLACK                   | `Packages.org.apache.poi.ss.usermodel.IndexedColors` | `Packages.org.apache.poi.ss.usermodel.IndexedColors.BLACK`                 |
| BLUE                    | `Packages.org.apache.poi.ss.usermodel.IndexedColors` | `Packages.org.apache.poi.ss.usermodel.IndexedColors.BLUE`                  |
| BLUE\_GREY              | `Packages.org.apache.poi.ss.usermodel.IndexedColors` | `Packages.org.apache.poi.ss.usermodel.IndexedColors.BLUE_GREY`             |
| BRIGHT\_GREEN           | `Packages.org.apache.poi.ss.usermodel.IndexedColors` | `Packages.org.apache.poi.ss.usermodel.IndexedColors.BRIGHT_GREEN`          |
| BROWN                   | `Packages.org.apache.poi.ss.usermodel.IndexedColors` | `Packages.org.apache.poi.ss.usermodel.IndexedColors.BROWN`                 |
| CORAL                   | `Packages.org.apache.poi.ss.usermodel.IndexedColors` | `Packages.org.apache.poi.ss.usermodel.IndexedColors.CORAL`                 |
| CORNFLOWER\_BLUE        | `Packages.org.apache.poi.ss.usermodel.IndexedColors` | `Packages.org.apache.poi.ss.usermodel.IndexedColors.CORNFLOWER_BLUE`       |
| DARK\_BLUE              | `Packages.org.apache.poi.ss.usermodel.IndexedColors` | `Packages.org.apache.poi.ss.usermodel.IndexedColors.DARK_BLUE`             |
| DARK\_GREEN             | `Packages.org.apache.poi.ss.usermodel.IndexedColors` | `Packages.org.apache.poi.ss.usermodel.IndexedColors.DARK_GREEN`            |
| DARK\_RED               | `Packages.org.apache.poi.ss.usermodel.IndexedColors` | `Packages.org.apache.poi.ss.usermodel.IndexedColors.DARK_RED`              |
| DARK\_TEAL              | `Packages.org.apache.poi.ss.usermodel.IndexedColors` | `Packages.org.apache.poi.ss.usermodel.IndexedColors.DARK_TEAL`             |
| DARK\_YELLOW            | `Packages.org.apache.poi.ss.usermodel.IndexedColors` | `Packages.org.apache.poi.ss.usermodel.IndexedColors.DARK_YELLOW`           |
| GOLD                    | `Packages.org.apache.poi.ss.usermodel.IndexedColors` | `Packages.org.apache.poi.ss.usermodel.IndexedColors.GOLD`                  |
| GREEN                   | `Packages.org.apache.poi.ss.usermodel.IndexedColors` | `Packages.org.apache.poi.ss.usermodel.IndexedColors.GREEN`                 |
| GREY\_25\_PERCENT       | `Packages.org.apache.poi.ss.usermodel.IndexedColors` | `Packages.org.apache.poi.ss.usermodel.IndexedColors.GREY_25_PERCENT`       |
| GREY\_40\_PERCENT       | `Packages.org.apache.poi.ss.usermodel.IndexedColors` | `Packages.org.apache.poi.ss.usermodel.IndexedColors.GREY_40_PERCENT`       |
| GREY\_50\_PERCENT       | `Packages.org.apache.poi.ss.usermodel.IndexedColors` | `Packages.org.apache.poi.ss.usermodel.IndexedColors.GREY_50_PERCENT`       |
| GREY\_80\_PERCENT       | `Packages.org.apache.poi.ss.usermodel.IndexedColors` | `Packages.org.apache.poi.ss.usermodel.IndexedColors.GREY_80_PERCENT`       |
| INDIGO                  | `Packages.org.apache.poi.ss.usermodel.IndexedColors` | `Packages.org.apache.poi.ss.usermodel.IndexedColors.INDIGO`                |
| LAVENDER                | `Packages.org.apache.poi.ss.usermodel.IndexedColors` | `Packages.org.apache.poi.ss.usermodel.IndexedColors.LAVENDER`              |
| LEMON\_CHIFFON          | `Packages.org.apache.poi.ss.usermodel.IndexedColors` | `Packages.org.apache.poi.ss.usermodel.IndexedColors.LEMON_CHIFFON`         |
| LIGHT\_BLUE             | `Packages.org.apache.poi.ss.usermodel.IndexedColors` | `Packages.org.apache.poi.ss.usermodel.IndexedColors.LIGHT_BLUE`            |
| LIGHT\_CORNFLOWER\_BLUE | `Packages.org.apache.poi.ss.usermodel.IndexedColors` | `Packages.org.apache.poi.ss.usermodel.IndexedColors.LIGHT_CORNFLOWER_BLUE` |
| LIGHT\_GREEN            | `Packages.org.apache.poi.ss.usermodel.IndexedColors` | `Packages.org.apache.poi.ss.usermodel.IndexedColors.LIGHT_GREEN`           |
| LIGHT\_ORANGE           | `Packages.org.apache.poi.ss.usermodel.IndexedColors` | `Packages.org.apache.poi.ss.usermodel.IndexedColors.LIGHT_ORANGE`          |
| LIGHT\_TURQUOISE        | `Packages.org.apache.poi.ss.usermodel.IndexedColors` | `Packages.org.apache.poi.ss.usermodel.IndexedColors.LIGHT_TURQUOISE`       |
| LIGHT\_YELLOW           | `Packages.org.apache.poi.ss.usermodel.IndexedColors` | `Packages.org.apache.poi.ss.usermodel.IndexedColors.LIGHT_YELLOW`          |
| LIME                    | `Packages.org.apache.poi.ss.usermodel.IndexedColors` | `Packages.org.apache.poi.ss.usermodel.IndexedColors.LIME`                  |
| MAROON                  | `Packages.org.apache.poi.ss.usermodel.IndexedColors` | `Packages.org.apache.poi.ss.usermodel.IndexedColors.MAROON`                |
| OLIVE\_GREEN            | `Packages.org.apache.poi.ss.usermodel.IndexedColors` | `Packages.org.apache.poi.ss.usermodel.IndexedColors.OLIVE_GREEN`           |
| ORANGE                  | `Packages.org.apache.poi.ss.usermodel.IndexedColors` | `Packages.org.apache.poi.ss.usermodel.IndexedColors.ORANGE`                |
| ORCHID                  | `Packages.org.apache.poi.ss.usermodel.IndexedColors` | `Packages.org.apache.poi.ss.usermodel.IndexedColors.ORCHID`                |
| PALE\_BLUE              | `Packages.org.apache.poi.ss.usermodel.IndexedColors` | `Packages.org.apache.poi.ss.usermodel.IndexedColors.PALE_BLUE`             |
| PINK                    | `Packages.org.apache.poi.ss.usermodel.IndexedColors` | `Packages.org.apache.poi.ss.usermodel.IndexedColors.PINK`                  |
| PLUM                    | `Packages.org.apache.poi.ss.usermodel.IndexedColors` | `Packages.org.apache.poi.ss.usermodel.IndexedColors.PLUM`                  |
| RED                     | `Packages.org.apache.poi.ss.usermodel.IndexedColors` | `Packages.org.apache.poi.ss.usermodel.IndexedColors.RED`                   |
| ROSE                    | `Packages.org.apache.poi.ss.usermodel.IndexedColors` | `Packages.org.apache.poi.ss.usermodel.IndexedColors.ROSE`                  |
| ROYAL\_BLUE             | `Packages.org.apache.poi.ss.usermodel.IndexedColors` | `Packages.org.apache.poi.ss.usermodel.IndexedColors.ROYAL_BLUE`            |
| SEA\_GREEN              | `Packages.org.apache.poi.ss.usermodel.IndexedColors` | `Packages.org.apache.poi.ss.usermodel.IndexedColors.SEA_GREEN`             |
| SKY\_BLUE               | `Packages.org.apache.poi.ss.usermodel.IndexedColors` | `Packages.org.apache.poi.ss.usermodel.IndexedColors.SKY_BLUE`              |
| TAN                     | `Packages.org.apache.poi.ss.usermodel.IndexedColors` | `Packages.org.apache.poi.ss.usermodel.IndexedColors.TAN`                   |
| TEAL                    | `Packages.org.apache.poi.ss.usermodel.IndexedColors` | `Packages.org.apache.poi.ss.usermodel.IndexedColors.TEAL`                  |
| TURQUOISE               | `Packages.org.apache.poi.ss.usermodel.IndexedColors` | `Packages.org.apache.poi.ss.usermodel.IndexedColors.TURQUOISE`             |
| VIOLET                  | `Packages.org.apache.poi.ss.usermodel.IndexedColors` | `Packages.org.apache.poi.ss.usermodel.IndexedColors.VIOLET`                |
| WHITE                   | `Packages.org.apache.poi.ss.usermodel.IndexedColors` | `Packages.org.apache.poi.ss.usermodel.IndexedColors.WHITE`                 |
| YELLOW                  | `Packages.org.apache.poi.ss.usermodel.IndexedColors` | `Packages.org.apache.poi.ss.usermodel.IndexedColors.YELLOW`                |

***

### PAPER\_SIZE

Possible paper sizes for a PrintSetup

**Properties**

| Name                             | Default                                                                         |
| -------------------------------- | ------------------------------------------------------------------------------- |
| A3\_PAPERSIZE                    | `Packages.org.apache.poi.ss.usermodel.PrintSetup.A3_PAPERSIZE`                  |
| A4\_EXTRA\_PAPERSIZE             | `Packages.org.apache.poi.ss.usermodel.PrintSetup.A4_EXTRA_PAPERSIZE`            |
| A4\_PAPERSIZE                    | `Packages.org.apache.poi.ss.usermodel.PrintSetup.A4_PAPERSIZE`                  |
| A4\_PLUS\_PAPERSIZE              | `Packages.org.apache.poi.ss.usermodel.PrintSetup.A4_PLUS_PAPERSIZE`             |
| A4\_ROTATED\_PAPERSIZE           | `Packages.org.apache.poi.ss.usermodel.PrintSetup.A4_ROTATED_PAPERSIZE`          |
| A4\_SMALL\_PAPERSIZE             | `Packages.org.apache.poi.ss.usermodel.PrintSetup.A4_SMALL_PAPERSIZE`            |
| A4\_TRANSVERSE\_PAPERSIZE        | `Packages.org.apache.poi.ss.usermodel.PrintSetup.A4_TRANSVERSE_PAPERSIZE`       |
| A5\_PAPERSIZE                    | `Packages.org.apache.poi.ss.usermodel.PrintSetup.A5_PAPERSIZE`                  |
| B4\_PAPERSIZE                    | `Packages.org.apache.poi.ss.usermodel.PrintSetup.B4_PAPERSIZE`                  |
| B5\_PAPERSIZE                    | `Packages.org.apache.poi.ss.usermodel.PrintSetup.B5_PAPERSIZE`                  |
| ELEVEN\_BY\_SEVENTEEN\_PAPERSIZE | `Packages.org.apache.poi.ss.usermodel.PrintSetup.ELEVEN_BY_SEVENTEEN_PAPERSIZE` |
| ENVELOPE\_10\_PAPERSIZE          | `Packages.org.apache.poi.ss.usermodel.PrintSetup.ENVELOPE_10_PAPERSIZE`         |
| ENVELOPE\_9\_PAPERSIZE           | `Packages.org.apache.poi.ss.usermodel.PrintSetup.ENVELOPE_9_PAPERSIZE`          |
| ENVELOPE\_C3\_PAPERSIZE          | `Packages.org.apache.poi.ss.usermodel.PrintSetup.ENVELOPE_C3_PAPERSIZE`         |
| ENVELOPE\_C4\_PAPERSIZE          | `Packages.org.apache.poi.ss.usermodel.PrintSetup.ENVELOPE_C4_PAPERSIZE`         |
| ENVELOPE\_C5\_PAPERSIZE          | `Packages.org.apache.poi.ss.usermodel.PrintSetup.ENVELOPE_C5_PAPERSIZE`         |
| ENVELOPE\_C6\_PAPERSIZE          | `Packages.org.apache.poi.ss.usermodel.PrintSetup.ENVELOPE_C6_PAPERSIZE`         |
| ENVELOPE\_CS\_PAPERSIZE          | `Packages.org.apache.poi.ss.usermodel.PrintSetup.ENVELOPE_CS_PAPERSIZE`         |
| ENVELOPE\_DL\_PAPERSIZE          | `Packages.org.apache.poi.ss.usermodel.PrintSetup.ENVELOPE_DL_PAPERSIZE`         |
| ENVELOPE\_MONARCH\_PAPERSIZE     | `Packages.org.apache.poi.ss.usermodel.PrintSetup.ENVELOPE_MONARCH_PAPERSIZE`    |
| EXECUTIVE\_PAPERSIZE             | `Packages.org.apache.poi.ss.usermodel.PrintSetup.EXECUTIVE_PAPERSIZE`           |
| FOLIO8\_PAPERSIZE                | `Packages.org.apache.poi.ss.usermodel.PrintSetup.FOLIO8_PAPERSIZE`              |
| LEDGER\_PAPERSIZE                | `Packages.org.apache.poi.ss.usermodel.PrintSetup.LEDGER_PAPERSIZE`              |
| LEGAL\_PAPERSIZE                 | `Packages.org.apache.poi.ss.usermodel.PrintSetup.LEGAL_PAPERSIZE`               |
| LETTER\_PAPERSIZE                | `Packages.org.apache.poi.ss.usermodel.PrintSetup.LETTER_PAPERSIZE`              |
| LETTER\_ROTATED\_PAPERSIZE       | `Packages.org.apache.poi.ss.usermodel.PrintSetup.LETTER_ROTATED_PAPERSIZE`      |
| LETTER\_SMALL\_PAGESIZE          | `Packages.org.apache.poi.ss.usermodel.PrintSetup.LETTER_SMALL_PAGESIZE`         |
| NOTE8\_PAPERSIZE                 | `Packages.org.apache.poi.ss.usermodel.PrintSetup.NOTE8_PAPERSIZE`               |
| PRINTER\_DEFAULT\_PAPERSIZE      | `Packages.org.apache.poi.ss.usermodel.PrintSetup.PRINTER_DEFAULT_PAPERSIZE`     |
| QUARTO\_PAPERSIZE                | `Packages.org.apache.poi.ss.usermodel.PrintSetup.QUARTO_PAPERSIZE`              |
| STATEMENT\_PAPERSIZE             | `Packages.org.apache.poi.ss.usermodel.PrintSetup.STATEMENT_PAPERSIZE`           |
| TABLOID\_PAPERSIZE               | `Packages.org.apache.poi.ss.usermodel.PrintSetup.TABLOID_PAPERSIZE`             |
| TEN\_BY\_FOURTEEN\_PAPERSIZE     | `Packages.org.apache.poi.ss.usermodel.PrintSetup.TEN_BY_FOURTEEN_PAPERSIZE`     |

***

### SHEET\_PANE : `enum`

Panes of a sheet used in split panes

**Properties**

| Name         | Type   | Default                                                       |
| ------------ | ------ | ------------------------------------------------------------- |
| LOWER\_RIGHT | `byte` | `Packages.org.apache.poi.ss.usermodel.Sheet.PANE_LOWER_RIGHT` |
| LOWER\_LEFT  | `byte` | `Packages.org.apache.poi.ss.usermodel.Sheet.PANE_LOWER_LEFT`  |
| UPPER\_LEFT  | `byte` | `Packages.org.apache.poi.ss.usermodel.Sheet.PANE_UPPER_LEFT`  |
| UPPER\_RIGHT | `byte` | `Packages.org.apache.poi.ss.usermodel.Sheet.PANE_UPPER_RIGHT` |

***

### VERTICAL\_ALIGNMENT : `enum`

Vertical alignments used in ExcelCellStyle

**Properties**

| Name        | Type                                                     | Default                                                              |
| ----------- | -------------------------------------------------------- | -------------------------------------------------------------------- |
| BOTTOM      | `Packages.org.apache.poi.ss.usermodel.VerticalAlignment` | `Packages.org.apache.poi.ss.usermodel.VerticalAlignment.BOTTOM`      |
| CENTER      | `Packages.org.apache.poi.ss.usermodel.VerticalAlignment` | `Packages.org.apache.poi.ss.usermodel.VerticalAlignment.CENTER`      |
| JUSTIFY     | `Packages.org.apache.poi.ss.usermodel.VerticalAlignment` | `Packages.org.apache.poi.ss.usermodel.VerticalAlignment.JUSTIFY`     |
| TOP         | `Packages.org.apache.poi.ss.usermodel.VerticalAlignment` | `Packages.org.apache.poi.ss.usermodel.VerticalAlignment.TOP`         |
| DISTRIBUTED | `Packages.org.apache.poi.ss.usermodel.VerticalAlignment` | `Packages.org.apache.poi.ss.usermodel.VerticalAlignment.DISTRIBUTED` |

### 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`](#excelworkbook)

Returns an empty ExcelWorkbook

| Param                 | Type                                                            | Description                                                                                                  |
| --------------------- | --------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| \[templateOrFileType] | `String` \| `plugins.file.JSFile` \| `Number` \| `Array.<byte>` | either an existing Excel file as template or one of the FILE\_FORMAT constants when creating empty workbooks |

**Example**

```js
// Create workbook and sheet
var workbook = scopes.svyExcelUtils.createWorkbook(scopes.svyExcelUtils.FILE_FORMAT.XLSX);
var sheet = workbook.createSheet("Test");

// Create style for the header
var headerStyle = workbook.createCellStyle();
headerStyle
   .setFont("Arial,1,12")
   .setFillPattern(scopes.svyExcelUtils.FILL_PATTERN.SOLID_FOREGROUND)
   .setFillForegroundColor(scopes.svyExcelUtils.INDEXED_COLOR.LIGHT_ORANGE)
   .setAlignment(scopes.svyExcelUtils.ALIGNMENT.CENTER);

var rowNum = 1;

// Create header row and cells
var row = sheet.createRow(rowNum ++);
var cell = row.createCell(1);
cell.setCellValue("Test 1", headerStyle);

cell = row.createCell(2);
cell.setCellValue("Test 2", headerStyle);

// Create some data and write to the sheet
var data = [[10, 35], [15, 47], [9, 22], [10, 33]];
for (var i = 0; i < data.length; i++) {
   row = sheet.createRow(rowNum ++);
   row.createCell(1).setCellValue(data[i][0]);
   row.createCell(2).setCellValue(data[i][1]);
}

// Create a style for the sum
var sumStyle = workbook.createCellStyle();
// Clone the default font, so we won't be changing the default
var font = sumStyle.cloneFont();
font.underline = scopes.svyExcelUtils.FONT_UNDERLINE.DOUBLE_ACCOUNTING;
font.isBold = true;

// Create formula cells at the bottom
row = sheet.createRow(rowNum ++);
cell = row.createCell(1);
cell.setCellStyle(sumStyle);
cell.setCellFormula("SUM(" + scopes.svyExcelUtils.getCellReferenceFromRange(2, 1 + data.length, 1, 1) + ")");

cell = row.createCell(2);
cell.setCellStyle(sumStyle);
cell.setCellFormula("SUM(" + scopes.svyExcelUtils.getCellReferenceFromRange(2, 1 + data.length, 2, 2) + ")");

// Write to file
var success = workbook.writeToFile("d:\\test.xls");
```

### createWorkbookFromDataSet(dataset, \[columns], \[headers], \[templateOrFileType], \[sheetNameToUse]) ⇒ [`DataSetExcelWorkbook`](#datasetexcelworkbook-servoyexcelworkbook)

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               | `JSDataSet`                                   | the dataset                                                                                                                                      |
| \[columns]            | `[ 'Array' ].<Number>`                        | the column numbers to be included in the sheet                                                                                                   |
| \[headers]            | `[ 'Array' ].<String>`                        | the text to be used as column headers                                                                                                            |
| \[templateOrFileType] | `String` \| `plugins.file.JSFile` \| `Number` | 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]     | `String`                                      | when a template is used, this is the name of the sheet to be filled                                                                              |

### createWorkbookFromFoundSet(foundset, dataproviders, \[headers], \[templateOrFileType], \[sheetNameToUse]) ⇒ [`FoundSetExcelWorkbook`](#foundsetexcelworkbook-servoyexcelworkbook)

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              | `JSFoundSet`                                  | the foundset                                                                                                                                               |
| dataproviders         | `[ 'Array' ].<String>`                        | the dataproviders to be used for the excel sheet                                                                                                           |
| \[headers]            | `[ 'Array' ].<String>`                        | the text to be used as column headers                                                                                                                      |
| \[templateOrFileType] | `String` \| `plugins.file.JSFile` \| `Number` | 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]     | `String`                                      | when a template is used, this is the name of the sheet to be filled                                                                                        |

### getCellReferenceFromRange(firstRow, lastRow, firstColumn, lastColumn) ⇒ `String`

Creates a cell reference (e.g. "A4:C92") from the given range

**Returns**: `String` - cellReference

| Param       | Type     |
| ----------- | -------- |
| firstRow    | `Number` |
| lastRow     | `Number` |
| firstColumn | `Number` |
| lastColumn  | `Number` |

### getRangeFromCellReference(cellReference) ⇒ `Object`

Converts a cell reference (e.g. "B4:AK234" or "C6") to an object holding first and last row and column

| Param         | Type     |
| ------------- | -------- |
| cellReference | `String` |

### getWorkbook(original) ⇒ [`ExcelWorkbook`](#excelworkbook)

Returns an ExcelWorkbook from the given file or media URL

| Param    | Type                                                | Description                         |
| -------- | --------------------------------------------------- | ----------------------------------- |
| original | `String` \| `plugins.file.JSFile` \| `Array.<byte>` | path to the file, file or media URL |

### isLoaded() ⇒ `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 | `PrintSetup` |

### 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

***


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.servoy.com/reference/servoyextensions/modules/home-7/api-svyexcelutils.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
