EasyCFM.COM ColdFusion Forums / Coding Help! / Download File to Excel

   Reply to Discussion | New Discussion << previous || next >> 
Posted By Discussion Topic: Download File to Excel

book mark this topic Printer-friendly Version  send this discussion to a friend  new posts last

rinaram
10-16-2002 @ 8:21 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 1
Joined: Oct 2002

I am using Cfgrid to display results of my query.  I would like to be able to download these results into Excel so that users can email updates to managers.

Can you please help?:quest:

Thank you
Rina Text

Webmaster
10-16-2002 @ 8:43 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Administrator
Posts: 4542
Joined: Jan 2002

Ok, the easiest way to do this is to create .CSV file.

A .CSV file is basically a comma delimited file. So you could create the following:

<cfoutput query="YourQuery">
  <cffile action="Append"
          file="export.csv"
          output="#FirstName#,#LastName#,#Email#">
</cfoutput>

This will create a file that contains:
Pablo,Varando,webmster@easycfm.com
John,Smith,john@smith.com

but you can open it in Excel and it'll be properly inserted. That is the easy way, the other way you can achieve this is to use COM objects (quite a bit more complicated, but if you're up to it here's where you can get more information about it.)

Thanks,
Pablo Varando
EasyCFM.COM, LLC.

[MORSEWEB]
10-21-2002 @ 12:19 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 7
Joined: Oct 2002

There are a bunch of free cf tags on the developer exchange that will do this for you too... May be worth checking out, I have used them before... they seem to work good...

Check here: http://devex.macromedia.com/developer/gallery/SearchResults.cfm?keywords=excel&x=10&y=13

-Randy

An Error Has Occurred... Just Kidding...


Website Designed and Developed by Pablo Varando.