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

Clone sheetFront to fix width of columns when export is called many times #58

Open
YoannB opened this issue Apr 7, 2017 · 1 comment

Comments

@YoannB
Copy link

YoannB commented Apr 7, 2017

In Sheet.js, the var "sheetFront" was used with operator "+=", so each time we call execute with columns config, "sheetFront" is modified.

Can you try to clone "sheetFront" when generate is called :

Sheet.prototype.generate = function(){
    var sheetFrontClone = sheetFront.slice(0);

    //....

    if (colsWidth !== "") {
        sheetFrontClone += '<cols>' + colsWidth + '</cols>';
    }
    xlsx.file(config.fileName, sheetFrontClone + '<x:sheetData>' + rows + '</x:sheetData>' + sheetBack);
}
@YoannB
Copy link
Author

YoannB commented Apr 13, 2017

I do many fixes in a fork, if you want see :

https://github.com/YoannB/Node-Excel-Export

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