Alex Rivera | Logout

Is there a Scala wrapper for Apache POI?

Asked 2011-02-17T17:06:15.763
21

I would like to use Apache POI to read/create Excel files in an Scala app. Sure, I can use the POI library directly, it's Java after all, but I would like to have the Scala feel. So is there a Scala wrapper bringing the Scala feel (using implicit conversions), i.e. some kind of "Scala-POI-DSL" freely available?

Edit
Report

2 Answers

4

This is utterly unhelpful, but I hacked up an Scala-ish DSL for POI. It allows code like

Workbook{
  Sheet("Multiplication"){
      for(i<-1 to 10){
         Row{
           for(j<-1 to 10){
             Cell(i*j)
           }
         }
      }
  }
}.writeToFile("multiplication.xls")

Sadly I can't give it out without checking with my boss, but to be honest it wasn't that hard to do. You should be able to reverse-engineer most of it from that example without much trouble.

answered 2011-05-30T11:54:32.997
1

I don't know of any Scala library for this kind of encapsulation.

Most questions around using apache POI are about iterators.
And the alexcheng project does import an Excel document, and has a test case.
But that's about it.

answered 2011-02-18T07:25:03.823

Your Answer