Cfspreadsheet railo extension (by andy j) hack to support basic read of xlsx files (excel 2007)

214 views
Skip to first unread message

melinite

unread,
Oct 3, 2011, 3:13:42 AM10/3/11
to Railo
simple hack to spreadsheet.cfc under the org cfpoi that Andy J wrote.

It modifies the "READ" function.

you will need to update some of the jars of poi that is packaged with
the original extension to http://poi.apache.org/download.html#POI-3.8beta4.


This is my LOADPOI function hack:

arrayAppend(Local.paths, expandPath('{railo-web-directory}'&'/lib/
poi-3.8-beta4-20110826.jar'));
arrayAppend(Local.paths, expandPath('{railo-web-directory}'&'/lib/
poi-ooxml-3.8-beta4-20110826.jar'));
arrayAppend(Local.paths, expandPath('{railo-web-directory}'&'/lib/
poi-ooxml-schemas-3.8-beta4-20110826.jar'));
//arrayAppend(Local.paths, expandPath('{railo-web-directory}'&'/
lib/dom4j-1.6.1.jar')); //not needed this railo server includes this
package already.
arrayAppend(Local.paths, expandPath('{railo-web-directory}'&'/lib/
stax-api-1.0.1.jar'));
arrayAppend(Local.paths, expandPath('{railo-web-directory}'&'/lib/
xmlbeans-2.3.0.jar'));
arrayAppend(Local.paths, expandPath('{railo-web-directory}'&'/lib/
poi-export-utility.jar')); //cfsearching XLSExport utils. (needed to
xls files)


and finally my hack for the READ function
https://gist.github.com/ec93bd1d2fce4441bab9

notice my primitive checking for xlsx on line 39 (it is a cfif block)
<!--- primitive xlsx detection --->
<cfif comparenocase(listlast(arguments.src,'.'),'xlsx')>

then line 130 is the meat of my hack.

don't know if it is proper to post here.


melinite

unread,
Oct 3, 2011, 3:16:51 AM10/3/11
to Railo
this will return a query object of the xlsx. Very primitive but needed
an easy way to read excel 2007+ files in a Railo environment.

Todd Rafferty

unread,
Oct 3, 2011, 6:22:36 AM10/3/11
to ra...@googlegroups.com
Thanks, I pointed AndyJ in this direction, hopefully he'll take a look into it.


On Mon, Oct 3, 2011 at 3:16 AM, melinite <meli...@gmail.com> wrote:
this will return a query object of the xlsx. Very primitive but needed
an easy way to read excel 2007+ files in a Railo environment.



--
~Todd Rafferty
Volunteer
Community Manager
Railo Server - Open Source
----

Andy Jarrett

unread,
Oct 3, 2011, 7:10:40 AM10/3/11
to ra...@googlegroups.com
Cheers all. I'll look at this asap

melinite

unread,
Oct 3, 2011, 12:32:43 PM10/3/11
to Railo
I just updated the code to parse Excel date fields correctly.
Reply all
Reply to author
Forward
0 new messages