We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
We have an excel which is generated with python openpyxl and adds a sheet named "test":
When trying to read this excel via exceljs streaming api, it doesn't return the correct sheet names, but "Sheet1", "Sheet2".
from openpyxl import Workbook wb = Workbook() test = wb.create_sheet("test") test["A1"] = "new value" wb.save("test.xlsx")
const Excel = require("exceljs"); const fs = require("fs/promises"); const path = require("path"); const run = async () => { const file = await fs.open(path.join(__dirname, "test.xlsx")); const fileStream = file.createReadStream(); const workbookReader = new Excel.stream.xlsx.WorkbookReader(fileStream, {}); for await (const worksheetReader of workbookReader) { console.log(worksheetReader.name); } }; run();
Within workbookRead.model.sheets the sheet name is provided. So I could look it up using
workbookRead.model.sheets
const sheetInfo = workbookReader.model.sheets.find((sheet) => sheet.id == worksheetReader.id); console.log(sheetInfo.name);
Here the issue is that the behaviour is very nondeterministic and workbookRead.model is not always defined.
workbookRead.model
When not using the streaming API, the sheets are resolved correctly. So it seems the issue is not within the excel itself:
const workbook = new Excel.Workbook(); await workbook.xlsx.readFile(path.join(__dirname, "test.xlsx")); workbook.eachSheet((sheet) => { console.log(sheet.name); });
The streaming API should return the correct sheet names using the streaming API.
n/a
The text was updated successfully, but these errors were encountered:
fix: make iterate-stream more resilient
e2a383c
fixes exceljs#2663
Successfully merging a pull request may close this issue.
馃悰 Bug Report
We have an excel which is generated with python openpyxl and adds a sheet named "test":
When trying to read this excel via exceljs streaming api, it doesn't return the correct sheet names, but "Sheet1", "Sheet2".
Steps To Reproduce
Within
workbookRead.model.sheets
the sheet name is provided. So I could look it up usingHere the issue is that the behaviour is very nondeterministic and
workbookRead.model
is not always defined.When not using the streaming API, the sheets are resolved correctly. So it seems the issue is not within the excel itself:
The expected behaviour:
The streaming API should return the correct sheet names using the streaming API.
Possible solution (optional, but very helpful):
n/a
The text was updated successfully, but these errors were encountered: