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

Can not read excel file #988

Closed
alfredalfie123 opened this issue Oct 17, 2019 · 2 comments
Closed

Can not read excel file #988

alfredalfie123 opened this issue Oct 17, 2019 · 2 comments

Comments

@alfredalfie123
Copy link

When I try to read my excel file, I got this error below:

TypeError: Cannot read property 'autoFilterRef' of null
    at TableXform.parseClose (/home/alfred/workspace/my-project/node_modules/exceljs/lib/xlsx/xform/table/table-xform.js:99:62)
    at SAXStream.<anonymous> (/home/alfred/workspace/my-project/node_modules/exceljs/lib/xlsx/xform/base-xform.js:83:21)
    at SAXStream.emit (events.js:209:13)
    at SAXStream.EventEmitter.emit (domain.js:476:20)
    at SAXParser.me._parser.<computed> [as onclosetag] (/home/alfred/workspace/my-project/node_modules/sax/lib/sax.js:258:17)
    at emit (/home/alfred/workspace/my-project/node_modules/sax/lib/sax.js:624:35)
    at emitNode (/home/alfred/workspace/my-project/node_modules/sax/lib/sax.js:629:5)
    at closeTag (/home/alfred/workspace/my-project/node_modules/sax/lib/sax.js:889:7)
    at SAXParser.write (/home/alfred/workspace/my-project/node_modules/sax/lib/sax.js:1436:13)
    at SAXStream.write (/home/alfred/workspace/my-project/node_modules/sax/lib/sax.js:239:18)
    at /home/alfred/workspace/my-project/node_modules/exceljs/lib/utils/stream-buf.js:206:14
    at new Promise (<anonymous>)
    at write (/home/alfred/workspace/my-project/node_modules/exceljs/lib/utils/stream-buf.js:205:14)
    at Array.map (<anonymous>)
    at StreamBuf._pipe (/home/alfred/workspace/my-project/node_modules/exceljs/lib/utils/stream-buf.js:211:34)
    at StreamBuf._flush (/home/alfred/workspace/my-project/node_modules/exceljs/lib/utils/stream-buf.js:275:14)
    at writeComplete (/home/alfred/workspace/my-project/node_modules/exceljs/lib/utils/stream-buf.js:288:14)
    at StreamBuf.end (/home/alfred/workspace/my-project/node_modules/exceljs/lib/utils/stream-buf.js:298:7)
    at StreamBuf.pipe (/home/alfred/workspace/my-project/node_modules/exceljs/lib/utils/stream-buf.js:346:12)
    at TableXform.parseStream (/home/alfred/workspace/my-project/node_modules/exceljs/lib/xlsx/xform/base-xform.js:102:12)
    at XLSX._processTableEntry (/home/alfred/workspace/my-project/node_modules/exceljs/lib/xlsx/xlsx.js:153:31)
    at /home/alfred/workspace/my-project/node_modules/exceljs/lib/xlsx/xlsx.js:320:30

Can someone help me?

@guymontreuil
Copy link

Same here ... comeonce can help?

@thambley
Copy link
Contributor

I have this problem when the autoFilter child of table is missing like this:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<table xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" id="1" name="Table1" displayName="Table1" ref="A1:K335" totalsRowShown="0"><tableColumns count="11"><tableColumn id="1" name="key"/><tableColumn id="2" name="data1"/><tableColumn id="3" name="data2"/><tableColumn id="4" name="data3"/><tableColumn id="5" name="data4"/><tableColumn id="6" name="data5"/><tableColumn id="7" name="data6"/><tableColumn id="8" name="data7"/><tableColumn id="9" name="data8"/><tableColumn id="10" name="data9"/><tableColumn id="11" name="data10"/></tableColumns><tableStyleInfo name="TableStyleLight9" showFirstColumn="0" showLastColumn="0" showRowStripes="0" showColumnStripes="0"/></table>

If I filter the table in excel and resave, the file is readable:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<table xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" id="1" name="Table1" displayName="Table1" ref="A1:K335" totalsRowShown="0"><autoFilter ref="A1:K335"/><tableColumns count="11"><tableColumn id="1" name="key"/><tableColumn id="2" name="data1"/><tableColumn id="3" name="data2"/><tableColumn id="4" name="data3"/><tableColumn id="5" name="data4"/><tableColumn id="6" name="data5"/><tableColumn id="7" name="data6"/><tableColumn id="8" name="data7"/><tableColumn id="9" name="data8"/><tableColumn id="10" name="data9"/><tableColumn id="11" name="data10"/></tableColumns><tableStyleInfo name="TableStyleLight9" showFirstColumn="0" showLastColumn="0" showRowStripes="0" showColumnStripes="0"/></table>

thambley added a commit to thambley/exceljs that referenced this issue Oct 31, 2019
Verify that autoFilter.model exists before accessing.
guyonroche added a commit that referenced this issue Oct 31, 2019
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

4 participants