Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workbook with multiple sheets with same placeholdes #2

Open
yenesey opened this issue Sep 12, 2016 · 0 comments
Open

Workbook with multiple sheets with same placeholdes #2

yenesey opened this issue Sep 12, 2016 · 0 comments

Comments

@yenesey
Copy link

yenesey commented Sep 12, 2016

If we do substitution on template with multiple sheets and the same placeholder on each sheet, we have strange behaviour:

use ./test/templates/t1.xlsx
copy first sheet and save template with 2 sheets (with same placeholders)

'use strict';
var fs = require("fs"),
    path = require("path"),
    XlsxTemplate = require('xlsx-template');
var template = new XlsxTemplate(    fs.readFileSync(path.join(__dirname, 't1.xlsx')))
var data = {
    extractDate : "2015-01-01",
    revision: "0.0.1"
}
template.substitute(1, data);
fs.writeFileSync( path.join(__dirname, 'output.xlsx'), template.generate(), 'binary');

/////////////////

placeholder "extractDate" - affected on both sheets, not only 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant