pjs.exportToExcel()
API to export the column text, types, and data of a given database table or view name to an Excel spreadsheet.
This API uses the write-excel-file npm package. Additional information on formats, styles, and other customizations can be found in the npm: write-excel-file documentation.
Parameters
Parameter Name | Valid Values | Description |
---|---|---|
|
| Required. |
|
| Optional. |
|
| Optional. |
|
| Optional. |
|
| Optional. |
|
| Optional. |
|
| Optional. |
|
| Optional. |
|
| Optional. |
|
| Optional. IBM i only. |
|
| Optional. |
|
| Optional. |
|
| Optional. |
applyColumnSchemaOverrides <Function>
Example
applyFinalChanges <Function>
Example
exportOptions <Object>
Example
Examples
Simple Call
pjs.exportToExcel({ dbObject: "MYTABLE" });
Call with dbSchema
and filePath
pjs.exportToExcel({
dbObject: "MYTABLE",
dbSchema: "MYSCHEMA",
filePath: "./exports/mytable.xlsx"
});
Call with exportOptions
pjs.exportToExcel({
dbObject: "MYTABLE",
exportOptions: {
fontFamily: "Arial",
fontSize: 10,
getHeaderStyle: (columnSchema) => ({
fontWeight: true,
color: "#ff0000"
})
}
});