🔀 Merge pull request #534 from RicardoE105/feature/spreadsheet-node

 added compression option
This commit is contained in:
Jan 2020-04-30 00:04:57 +02:00 committed by GitHub
commit 6663b82fac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -173,6 +173,24 @@ export class SpreadsheetFile implements INodeType {
placeholder: 'Add Option',
default: {},
options: [
{
displayName: 'Compression',
name: 'compression',
type: 'boolean',
displayOptions: {
show: {
'/operation': [
'toFile',
],
'/fileFormat': [
'xlsx',
'ods',
],
},
},
default: false,
description: 'Weather compression will be applied or not',
},
{
displayName: 'File Name',
name: 'fileName',
@ -342,10 +360,16 @@ export class SpreadsheetFile implements INodeType {
wopts.bookType = 'rtf';
} else if (fileFormat === 'ods') {
wopts.bookType = 'ods';
if (options.compression) {
wopts.compression = true;
}
} else if (fileFormat === 'xls') {
wopts.bookType = 'xls';
} else if (fileFormat === 'xlsx') {
wopts.bookType = 'xlsx';
if (options.compression) {
wopts.compression = true;
}
}
// Convert the data in the correct format