To finish up my findings (I know I am talking to my self)...

If you download that jar (http://www.andykhan.com/jexcelapi/), slap it
into the C:\CFusionMX\lib (or whatever) directory, and restart cf you
can read excel files like so:

<cfset filepath = "C:\test\test.xls">
<cfscript>
//get a handle to the workbook file
wfile = createObject("java","java.io.File").init(filepath);

//create the workbook and load the file
workbook = createObject("java","jxl.Workbook");

//get a writeable workbook
wworkbook = createObject("java","jxl.write.WritableWorkbook");
wworkbook = workbook.getWorkbook(wfile);

//get the first sheet
sheet = createObject("java","jxl.write.WritableSheet");
//sheet = createObject("java","jxl.Sheet");
sheet = wworkbook.getSheet("Sheet1");
</cfscript>

<cfset rowslen = sheet.getRows()>
<cfloop from="0" to="#rowslen-1#" index="q">
<cfoutput>#sheet.getCell(0,javacast('int',q)).getContents()#</cfoutput> |
<cfoutput>#sheet.getCell(1,javacast('int',q)).getContents()#</cfoutput> |
<cfoutput>#sheet.getCell(2,javacast('int',q)).getContents()#</cfoutput>
<br />
</cfloop>

I am doing an import process right now so I dont need to write excel
files, but this library is pretty cool if you are looking for a (free
(LGPL)) Excel API

On Sun, 8 Aug 2004 10:00:15 -0700, Rob <[EMAIL PROTECTED]> wrote:
> I was doing some research on something totally unrelated and happened upon this
>
> http://www.andykhan.com/jexcelapi/
>
> A java library to read and modify M$ Excel workbooks. Theoretically
> you could just use it in cfmx (or maybe MM could put it in blackstone
> :-o). I haven't used it, but there have been several post asking how
> to do it over the years so I thought I'd throw it out there.
>
> Cheers
> --
> ~The cfml plug-in for eclipse~
> http://cfeclipse.tigris.org
> ~open source xslt IDE~
> http://treebeard.sourceforge.net
> ~open source XML database~
> http://ashpool.sourceforge.net
>

--
~The cfml plug-in for eclipse~
http://cfeclipse.tigris.org
~open source xslt IDE~
http://treebeard.sourceforge.net
~open source XML database~
http://ashpool.sourceforge.net
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to