Giter VIP home page Giter VIP logo

Comments (2)

 avatar commented on August 23, 2024

The changes you proposed in the pull request #7 are made to the source files under bits and compiled. There is a new test in tests\test-styles.js that verifies styles in blank cells persist round trip. Changes are merged into the beta branch (https://github.com/protobi/js-xlsx#beta), tagged as version 0.8.6 and published to npm and bower.

describe('styles with blank cells', function () {
  it ('retains styles with blank cells', function() {


    var OUTFILE = '/tmp/ex1.xlsx';
    var OUTFILE2 = '/tmp/ex1a.xlsx';

    var workbook = {
      SheetNames : ["Sheet1"],
      Sheets: {
        "Sheet1": {
          "B2": {v: "Top left", s: { border: { top: { style: 'medium', color: { rgb: "FFFFAA00"}}, left: { style: 'medium', color: { rgb: "FFFFAA00"}} }}},
          "C2": {v: "Top right", s: { border: { top: { style: 'medium', color: { rgb: "FFFFAA00"}}, right: { style: 'medium', color: { rgb: "FFFFAA00"}} }}},
          "B3": {v: "Bottom left", s: { border: { bottom: { style: 'medium', color: { rgb: "FFFFAA00"}}, left: { style: 'medium', color: { rgb: "FFFFAA00"}} }}},
          "C3": {v: "", s: { border: { bottom: { style: 'medium', color: { rgb: "FFFFAA00"}}, right: { style: 'medium', color: { rgb: "FFFFAA00"}} }}},
          "!ref":"B2:C3"
        }
      }
    };

    // write the file and read it back...
    XLSX.writeFile(workbook, OUTFILE, {bookType: 'xlsx', bookSST: false});
    var workbook2 = XLSX.readFile(OUTFILE, {cellStyles: true});
    assert(basicallyEquals(workbook.Sheets, workbook2.Sheets));

    XLSX.writeFile(workbook2, OUTFILE2, {bookType: 'xlsx', bookSST: false});
    var workbook3 = XLSX.readFile(OUTFILE2, {cellStyles: true});
    assert(basicallyEquals(workbook.Sheets, workbook3.Sheets))
  });
});

from js-xlsx.

azukaar avatar azukaar commented on August 23, 2024

Nice, perfect

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.