Coder Social home page Coder Social logo

workbook's People

Contributors

pietersv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

workbook's Issues

Support for cell width

Add in headers an attribute for width cells or auto width cell if text cell is bigger.

file gets exported for example 3 but without any color or font

<script type="text/javascript" src="/Style Library/shim.js"></script> <script type="text/javascript" src="/Style Library/jszip.js"></script> <script type="text/javascript" src="/Style Library/xlsx.js"></script> <script type="text/javascript" src="/Style Library/date.js"></script> <script type="text/javascript" src="/Style Library/DragAndDropForm.js"></script> <script type="text/javascript" src="/Style Library/FileSaver.min.js"></script> <script type="text/javascript" src="/Style Library/workbook.js"></script> <script> console.log('hello'); if(typeof XLSX === 'undefined' && typeof require !== 'undefined') XLSX = require('xlsx'); var workbook = { SheetNames: ['Sheet 1'], Sheets: { 'Sheet 1': {'!ref': 'A1:A1'}}}; workbook.Sheets['Sheet 1']['A1'] = {"v": "Hello Red Arial 24pt", "s": {font: {name: "Arial", sz: 29, color: {rgb: "FFFF0000"}}}} // $("#out").text(JSON.stringify(wb,null,4)); var wopts = { bookType:'xlsx', bookSST:false, type:'binary' }; var wbout = XLSX.write(workbook,wopts); /* the saveAs call downloads a file on the local machine */ saveAs(new Blob([s2ab(wbout)],{type:""}), "test.xlsx") </script>

Sheet API - rows and cells

Would be nice to have an API like:

wb.createSheet('Abutters', options) // default styles and other options
  .row(options) // default options for row, cells inherit these options unless overwritten
    .cell(value, options) 
    .cell(value, options)
  .row() // 1 empty row
  .rowOffset(2) // 2 empty rows
  .row(value, options) // merged
    .cellOffset(5) // 5 empty cells
    .cell(value)
  .row(options)
    .cells([1, 2, 3]) // 3 cells with values only, work well with default row options
  .finalize();

Or something similar. This could make it open to things like currencyCell(value, format) or other cell types.

Style export not working from browser

I've managed to create xlsx files through node without any problems, however doing the same through the browser creates files that don't have any styling.

I used the code from example.html for my tests except I replaced calls to JSDateToExcelDate() with simple values as the JSDateToExcelDate() function wasn't included.

defaultCellStyle API

What's the API for the defaultCellStyle attribute for writeFile? Is that part of your js-xlsx fork or is that in the normal project. I can't find the details anywhere.

TypeError: Cannot read property 'v' of null

This is my solution that you can change in the library
On line 128 you should change the validation.

var cell = (data[R][C] && typeof data[R][C] == 'object' ? data[R][C] : { v: data[R][C] });
if (cell.v === null) continue;

instead of

var cell = (typeof data[R][C] == 'object' ? data[R][C] : { v: data[R][C] });
if (cell.v == null) continue;

because the error of a null cell value stop the execution process and does not generate the Excel file

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.