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

Convert array of objects in different excel sheet in one excel #24

Open
user1702 opened this issue Dec 17, 2018 · 0 comments
Open

Convert array of objects in different excel sheet in one excel #24

user1702 opened this issue Dec 17, 2018 · 0 comments

Comments

@user1702
Copy link

Using below code, not able to convert the data into one excel with mutiple sheets. I am getting all data in one sheet.

var  jsonXlsx = [[{ "Name": "Eddie", "Email": "edward@mail" }], [{ "Name": "Nico", "Email": "nicolas@mail" }]] ;
const sheets = ['a','b'];
var excelPageData = [];
/* Generate automatic model for processing (A static model should be used) */
var model = mongoXlsx.buildDynamicModel(jsonXlsx);

/* Generate Excel */
  excelPageData.push(mongoXlsx.mongoData2XlsxData(jsonXlsx, model));
  mongoXlsx.mongoData2XlsxMultiPage(excelPageData, sheets, function(err, data) {
	console.log(err)
  console.log('File saved at:', data.fullPath); 
  });
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