added compression option

This commit is contained in:
ricardo 2020-04-29 16:12:16 -05:00
parent 73edcdcbc4
commit 8e138ddf2d

View file

@ -173,6 +173,24 @@ export class SpreadsheetFile implements INodeType {
placeholder: 'Add Option', placeholder: 'Add Option',
default: {}, default: {},
options: [ 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', displayName: 'File Name',
name: 'fileName', name: 'fileName',
@ -342,10 +360,16 @@ export class SpreadsheetFile implements INodeType {
wopts.bookType = 'rtf'; wopts.bookType = 'rtf';
} else if (fileFormat === 'ods') { } else if (fileFormat === 'ods') {
wopts.bookType = 'ods'; wopts.bookType = 'ods';
if (options.compression) {
wopts.compression = true;
}
} else if (fileFormat === 'xls') { } else if (fileFormat === 'xls') {
wopts.bookType = 'xls'; wopts.bookType = 'xls';
} else if (fileFormat === 'xlsx') { } else if (fileFormat === 'xlsx') {
wopts.bookType = 'xlsx'; wopts.bookType = 'xlsx';
if (options.compression) {
wopts.compression = true;
}
} }
// Convert the data in the correct format // Convert the data in the correct format