Giter VIP home page Giter VIP logo

Comments (5)

Ajolos avatar Ajolos commented on August 23, 2024

I found that the problem is generated by sheetViews node in worksheets/sheet1.xml file. When I comment out the lines that append this node to output file, everything seems to work just fine.

from js-xlsx.

pietersv avatar pietersv commented on August 23, 2024

@Ajolos Thank you for reporting this. I'm able to print fine in OSX Office 2011. Not a comprehensive test but i can run that quickly. Differencing the downloaded and saved files, the difference in that section is the saved file does not have the attribute showGridlines="1". It seems that "1" is the assumed value if not specified and should not be in the XML.

Can you try commenting out line xlsx.js:7843 (or 67_bits.js:311 then make) and tell me if the problem persists?

showGridLines: opts.showGridLines == false ? '0' : '1',

from js-xlsx.

Ajolos avatar Ajolos commented on August 23, 2024

Well, commenting out the line you pointed didn't change anything - Excel still crashes after pressing 'Print'. However, when I comment out the next line
tabSelected: opts.tabSelected === undefined ? '1' : opts.tabSelected,
(node sheetView in output file has no attribute tabSelected)
or change its default value to '0'
tabSelected: opts.tabSelected === undefined ? '0' : opts.tabSelected,
(node sheetView in output file has attribute tabSelected="0")
I can print the file successfully.
Does it make any sense to you? So far I found the tabSelected attribute definition:

Flag indicating whether this sheet is selected. When only 1 sheet is selected and active, this value should be in synch with the activeTab value. In case of a conflict, the Start Part setting wins and sets the active sheet tab.

I didn't debug the whole library, but in the source code activeTab is mentioned only once - in line 8352:
var WBViewDef = [ ['activeTab', '0'], ... //window{Height,Width}, {x,y}Window ];

It seems like the activeTab is set to '0' by default, but tabSelected is set to '1', which is in conflict with the definition (should be in sync).

from js-xlsx.

pietersv avatar pietersv commented on August 23, 2024

This is great. Working into next release.

from js-xlsx.

knownasilya avatar knownasilya commented on August 23, 2024

Same as #29? Will test 0.8.13 and let you know tomorrow if it fixed my issue.

from js-xlsx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.