Append more values to sharedStrings of workbook
My workbook is already loaded with values and placeholders. The total of sharedStrings is now 530. I would like to add(append) more values to the sharedStrings along with a loop.
This is library for report generation, why do you want to put values into sharedStrings using it?
Hi @kant2002, I am also using it for report generation. In my case, I am delaying the values parsed into template.substitute() by a second using mqtt. The values are 100 rows each second and the total is 1500.
It does not work as expected. The workbook remains same with first 100 rows. Is there anyway like appending values to the workbook?
Aah, now it make sense, so you essentially want stream substitution process. And be able append more substitution values over and over again until you done. Is this correct?
Example
var batch1 = [
{name: "John Smith", age: 20},
{name: "Bob Johnson", age: 22}
];
// Perform substitution
template.substitute(sheetNumber, values);
var batch2 = [
{name: "Andrii Hopak", age: 33},
{name: "Marat Beysabekov", age: 52}
];
// Feed additional data to substitution process
template.continueSubstitute(sheetNumber, values);
It is throwing this error -
debug: TypeError: template.continueSubstitute is not a function
There no such functionality in the library at the moment. You have to collect all data into one object, and if you are done, then perform substitution.
Understood @kant2002. In addition, does this library support merging multiple excel files into one? If it does, it solves my issue.
No, merging of XLSX files should happens via other means. This library is for simple template substitution.