Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Try to handle the case where a <c> element is missing an r attribute#537

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

papandreou
Copy link
Contributor

@papandreoupapandreou commentedApr 9, 2018
edited
Loading

I've run into an Excel spreadsheet where some<c> elements do not have address references. It looks like it's some kind of shorthand where it's implicitly the next cell, and Excel opens the spreadsheet fine. Here's a pretty-printed snippet from the spreadsheet:

  <sheetData>    <rowr="1"spans="1:1"ht="18"customHeight="1">      <cr="A1"s="1"t="s">        <v>0</v>      </c>    </row>    <rowr="2"spans="1:1"ht="12.75"customHeight="1">      <cr="A2"s="2"t="s">        <v>1</v>      </c>    </row>    <rowr="3"spans="1:1"ht="12.75"customHeight="1">      <cr="A3"s="2"t="s">        <v>2</v>      </c>    </row>    <rowr="5"spans="1:12"ht="12.75"customHeight="1">      <cr="A5"s="4"t="s">        <v>51</v>      </c>      <cs="4"t="s">        <v>52</v>      </c>      <cs="4"t="s">        <v>53</v>      </c>      <cs="4"t="s">        <v>54</v>      </c>      ...

Exceljs breaks with:

(node:3101) TypeError: Cannot read property 'match' of undefined    at Object.decodeAddress (/Users/andreaslind/work/exceljs/lib/utils/col-cache.js:93:21)    at value.cells.forEach.cellModel (/Users/andreaslind/work/exceljs/lib/doc/row.js:325:46)    at Array.forEach (<anonymous>)    at module.exports.set model [as model] (/Users/andreaslind/work/exceljs/lib/doc/row.js:319:17)    at model.rows.forEach.rowModel (/Users/andreaslind/work/exceljs/lib/doc/worksheet.js:595:17)    at Array.forEach (<anonymous>)    at module.exports._parseRows (/Users/andreaslind/work/exceljs/lib/doc/worksheet.js:592:16)    at module.exports.set model [as model] (/Users/andreaslind/work/exceljs/lib/doc/worksheet.js:606:10)    at value.worksheets.forEach.worksheetModel (/Users/andreaslind/work/exceljs/lib/doc/workbook.js:197:23)    at Array.forEach (<anonymous>)

(The line numbers might be off, as I'm currently running an older version, unfortunately)

I'm not sure the enclosed solution is per spec. Maybe someone else knows more?

And yes, it's actually the same spreadsheet that caused#536 -- I'll follow up if I'm able to find out how it was generated.

@papandreou
Copy link
ContributorAuthor

I just learned that the Excel file in question is an export fromXero, which is a piece of accounting software.

@guyonrocheguyonroche merged commitea6aaa1 intoexceljs:masterApr 13, 2018
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@papandreou@guyonroche

[8]ページ先頭

©2009-2025 Movatter.jp