glebm / to_spreadsheet

Render XLSX from Rails using existing views (html ⇒ xlsx)
Other
91 stars 37 forks source link

Formatting support #8

Closed glebm closed 11 years ago

glebm commented 12 years ago

I have pushed the initial framework for formatting support (docs in readme)

There is probably still some styling support to be added Enhancements and bug reports are welcome

The new version has switched from using spreadsheet gem to axlsx

@adamburmister @mjohnsen @emiellohr @moskrin

randym commented 11 years ago

thanks for using axlsx (and travis-ci!)

Don't forget to update your gemspec before you release. Looks like your Gemfile is pulling axlsx but the gemspec depends on spreadsheet?

glebm commented 11 years ago

Thanks for making it! :) Good catch, gemspec fixed, rc2 is out!

randym commented 11 years ago

Thanks mate. I should also say that i really think you idea is awesome. Use haml as a dsl for making spreadsheets has tremendous appeal. wondering about crazy stuff like %a for hyperlinks, styles, charting, formula and conditional formatting. Serious potential here. When i've wrapped my head around what you are doing here I'll definitely be making a few pull requests.

glebm commented 11 years ago

That's great! I've built extensible architecture, but my axlsx experience is limited (I've added inline styling and columnInfo support so far)

Here is how one can add a transform for all %a elements:

format 'td,th', lambda { |cell| 
  node_from_entity(cell).css('a').each { |a|
    cell.value = ... 
  }
}

The code can benefit from more refactoring (with each new feature I will try to improve the internals) At the moment all the DSL stuff and a couple of other methods are in context.rb, but I will rewrite it soon (before release)

glebm commented 11 years ago

no issues reported after 2 weeks -> 1.0.0 released!