Sorry non-techies, this is really for (ruby-)techies.
For some time I’ve been working on a ruby gem that helps me on my project work, and may also help other ruby programmers, to work with table imports and exports more easily. Although there are other gems that allow you to read and write to different formats, of which the roo-gem is probably the most well know, I was particularly interested in writing Excel files based on templates.
I wanted to offer my clients more user-friendly Excel files that used some of the more advanced functionality of modern Spreadsheets (AutoFilter, printer styles) that couldn’t be offered by just manipulating styles and formatting using the existing rubygems. Which got me started to think about creating templates to start from, instead of starting from scratch using one of the Gems. Using another Excel file, however, wasn’t as easy as expected and here is where the Workbook gem comes in: to make that easier. Aditionnaly, it is simply easier to style a template in your spreadsheet program of choice (whether it be Excel, Open/LibreOffice, Calc or whatever (although for optimal compatibility with Excel, using Microsoft’s Excel is actually recommended)).
The workbook gem isn’t only about making styling easier. For importers, for example, I try to do a bit of extra type detection for dates and allow for accessing values based on the column names as defined in the header row. Additionally I tried to abstract away the Excel peculiarities and kept as close as possible to an array-like interface, much like (Faster)CSV does.
Already curious? You’ll find the Workbook-gem on RubyGems.
Ok, not yet convinced? Here is a list with more features:
#to_css
parameter for cells, so you’ll be able to create a HTML representation more easilyYou’ll find the Workbook-gem on RubyGems. If you would like to contribute, please see github.com/murb/workbook
Enjoyed this? Follow me on Mastodon or add the RSS, euh ATOM feed to your feed reader.
Dit artikel van murblog van Maarten Brouwers (murb) is in licentie gegeven volgens een Creative Commons Naamsvermelding 3.0 Nederland licentie .