I second Blake's suggestion. I followed that same article he referenced, and it works great. I had a CF7 server with the POI jar files in the WEB-INF folder. I'm using this version:
poi-scratchpad-3.2-FINAL-20081019.jar poi-contrib-3.2-FINAL-20081019.jar poi-3.2-FINAL-20081019.jar With the code I wrote, I only wanted to return a single cell, and I gave the user the ability to specify which cell to read into the DB. I used the cfc provided by Ben's blog with some slight customizations here and there. It's been very effective with only one issue. For whatever reason, if the top row of cells is blank, the code automatically assumes it's a header row and the row count is then off by one - even when I pass in the parameter that there is no header row. Other than that, it works great. I can send you a code snippet of how I utitilize it off list sometime if you want. > Thanks Blake I did glance at this blog post. My needs are very basic > though. > Just a simple read of the csv file and import its records into a db table. > I'm not opposed to just writing some of my own code for this but just > thought there might be something really quick and easy to use. This post > seems to focus on doing the exact opposite of what I need (query to > spreadsheet). > > I'm still on the hunt for a quick solution but if I don't come up with > something super easy and quick to use, I think I may just roll my own code > out. > > Thanks again, > > Dsuty > > On Fri, Mar 6, 2009 at 9:42 AM, <[email protected]> wrote: > >> Dusty, >> >> I have used the Java POI tool in the past. It's easy to implement, >> it is very fast (even at thousands of records and multiple worksheets) >> at >> reading/building an excel document. >> >> I found this link on Ben Nadel's blog, he has built a nice cfc utility >> to >> do the work for you, you may just have change a few mappings. >> >> http://www.bennadel.com/blog/469-Creating-Microsoft-Excel-Files-Using-ColdFusion-And-POI.htm >> >> >> You should definitely be able to use it to read the excel file and then >> insert into the db, as far as a custom tag to do both (file upload & >> read), >> I do not have that. If you don't specifially need the file you can use >> the >> POI utility to read it on the fly and then import. >> >> Blake >> >> >> >> Blake Kiser >> UPS - Business Information & Analysis >> SCS - S530A >> 12380 Morris Rd. >> Alpharetta, GA 30005 >> (678) 746-4679, atlas 480-4679 >> >> >> ------------------------------ >> *From:* [email protected] [mailto:[email protected]] *On Behalf Of *Dusty >> Hale >> *Sent:* Friday, March 06, 2009 9:31 AM >> *To:* [email protected] >> *Subject:* [ACFUG Discuss] excel or csv to database table >> >> Hi I need to implement some CF code that does this and before I write >> all >> the code, I thought certainly there has got to be a custom tag or cfc >> that >> already does this: >> >> 1. Upload excel or csv file to server. >> 2. Import the excel sheet or csv file into a database table. >> >> I found an upload custom tag and now I am looking for any advise or >> recommendation on a custom tag or cfc or piece of code that will handle >> the >> import part. If anyone knows of a good solution for this, please share. >> Much >> appreciation! >> >> Thanks, >> >> Dusty >> ------------------------------------------------------------- >> To unsubscribe from this list, manage your profile @ >> http://www.acfug.org?fa=login.edituserform >> >> For more info, see http://www.acfug.org/mailinglists >> Archive @ http://www.mail-archive.com/discussion%40acfug.org/ >> List hosted by FusionLink <http://www.fusionlink.com> >> ------------------------------------------------------------- > > > > > -- > Dusty Hale > Website: www.DustyHale.com > Email: [email protected] > Phone (Atlanta): 404.474.3754 > ------------------------------------------------------------- To unsubscribe from this list, manage your profile @ http://www.acfug.org?fa=login.edituserform For more info, see http://www.acfug.org/mailinglists Archive @ http://www.mail-archive.com/discussion%40acfug.org/ List hosted by http://www.fusionlink.com -------------------------------------------------------------
