-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[BUG] Incorrect Worksheet Name on Streaming XLSX Reader #1364
Comments
@whizdummy I found that there is indeed something unreasonable in the Source CodeThe function sheet-xform.js should be used to resolve worksheet names. // sheet-xform.js
parseOpen(node) {
if (node.name === 'sheet') {
this.model = {
name: utils.xmlDecode(node.attributes.name),
id: parseInt(node.attributes.sheetId, 10),
state: node.attributes.state,
rId: node.attributes['r:id'],
};
return true;
}
return false;
} The following code will build an instance of // workbook-reader.js
*_parseWorksheet(iterator, sheetNo) {
this._emitEntry({type: 'worksheet', id: sheetNo});
const worksheetReader = new WorksheetReader({workbook: this, id: sheetNo, iterator, options: this.options});
if (this.options.worksheets === 'emit') {
yield {eventType: 'worksheet', value: worksheetReader};
}
} I think that workbook-xform.js should be used to parse the workbook.xml file. // const WorkbookPropertiesManager = require('../../xlsx/xform/book/workbook-properties-xform');
const WorkbookManager = require('../../xlsx/xform/book/workbook-xform'); |
@Alanscut that looks reasonable. Could you put together a PR with a potential fix (or an attempt of it) and with a test using the provided xlsx? |
Do you plan on addressing this any time soon? |
🐛 Bug Report
I am having problems getting correct worksheet name when using streaming xlsx reader (async iteration). The first worksheet always defaults to Sheet1 regardless of name.
Lib version: 4.1.0
Steps To Reproduce
Sample Template.xlsx
The expected behaviour:
Worksheet name should be Sum Worksheet instead of Sheet1.
The text was updated successfully, but these errors were encountered: