Giter Site home page Giter Site logo

simple_xlsx_writer's Introduction

Description

This is a simple, no-fuss generator for OpenXML (aka XLSX) files. No formatting or styles included -- just raw content with a few basic datatypes supported. Produced output is tested to be compatible with:

  • Open Office 3.2 series (Linux, Mac, Windows)
  • Neo Office 3.2 series (Mac)
  • Microsoft Office 2007 (Windows)
  • Microsoft Office 2010 (Windows)
  • Microsoft Office 2008 for Mac (versions 12.2.5 or above)
  • Microsoft Excel Viewer (Windows)

iWork's Numbers does not appear to support the inline string storage model used by this gem. Apple may release a fix for this eventually, but for now, I have avoided the more common shared string table method as it cannot be implemented in linear time.

Sample

require 'simple_xlsx'

serializer = SimpleXlsx::Serializer.new("test.xlsx") do |doc|
  doc.add_sheet("People") do |sheet|
    sheet.add_row(%w{DoB Name Occupation})
    sheet.add_row([Date.parse("July 31, 1912"), 
                  "Milton Friedman", 
                  "Economist / Statistician"])
  end
end

License

See attached LICENSE for details.

Credits

simple_xlsx_writer's People

Contributors

bjhess avatar jumph4x avatar tjschuck avatar zsombor 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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  avatar  avatar  avatar

simple_xlsx_writer's Issues

Forward slash in sheet name causes Excel to implode

I have an app that is using the simple_xslx_writer gem to generate some spreadsheets. The sheet names can come from user input elsewhere in the system (since these are generated programmatically). One workbook sheet has a forward slash it's name. I unzipped the xlsx file, removed the forward slash and rezipped the file and was then able to open it.

I actually have a fork of your app that I've applied Jussi Pasenan's patch to and made all the tests pass. I'll look in to resolving the issue in my fork and will create a pull request if you're interested.

Follow up from closed Issue #1

Follow up from closed Issue #1

Thank you all for creating such an easy to use library. I wanted to follow up on this thread to report current findings on this issue.

Issue is present with Excel 2011 Mac as well as Excel 2013 (Win7). Both versions of Excel complain about corrupted files. After clicking on that error prompt, Excel goes through a recovery process and the file and content are available.

Issue probably stems from known issues with the Zip library. Here's a description of the issue on RubyZip's repo.

I'll see if it's an older gem issue and if there are available solutions. I'll report back here with what I find.

Name conflict in Rails3

When adding the gem in my Gemfile like this

gem 'simple_xlsx_writer', :require => 'simple_xlsx'

I get this:

/Users/libo/.rvm/gems/ruby-1.8.7-head/gems/builder-2.1.2/lib/builder/xchar.rb:14:in `check_for_name_collision': Name Collision: Method 'to_xs' is already defined in String (RuntimeError)
from /Users/libo/.rvm/gems/ruby-1.8.7-head/gems/builder-2.1.2/lib/builder/xchar.rb:21
from /Users/libo/.rvm/gems/ruby-1.8.7-head/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:239:in `require'
from /Users/libo/.rvm/gems/ruby-1.8.7-head/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:239:in `require'

Excel cannot open this file.

I tried your writer, but got the error:

Excel cannot open this file.
The file might have been damaged or modified from its original format.

When I open it up in "Numbers", I see only the columns with numbers or dates in them, no strings.

Option to clean up temp files?

Thanks for this library! Is there an option I have to set to get simple xlsx to clean up after itself? It leaves half a dozen temp files laying around every time I use it to generate a new 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.