Paolo Castagna wrote:
> Damian Steer wrote:
>>>> […] Is your code anywhere available and/or open source?
>> It's not, and it wouldn't be useful since the bulk is pointless styling code.
>>
>> Look at <http://poi.apache.org/spreadsheet/how-to.html#sxssf> and you'll get 
>> the idea. About 20 lines of code?
> 
> Ack.
> 
> I'll do.

For those interested in seeing how to use Apache POI to generate a Microsoft
Excel spreadsheet from a ResultSet, here is a complete example:
https://github.com/castagna/jena-examples/blob/995d7acf8fcb3f9a8f7264dfd0902cdddfc00279/src/main/java/org/apache/jena/examples/ExampleARQ_06.java

Code is copied from TSVOutput.java:
http://svn.apache.org/repos/asf/incubator/jena/Jena2/ARQ/tags/jena-arq-2.9.0-incubating/src/main/java/com/hp/hpl/jena/sparql/resultset/TSVOutput.java

With some plumbing here and there an ExcelOutput which extends OutputBase could
be added, but given the presence of CSV and TSV already I am not sure this is
useful to people or not.

I've not done anything on the formatting front, however Apache POI allows that.

Paolo


Reply via email to