Topic: Download File to Excel


rinaram    -- 10-16-2002 @ 8:21 AM
  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
  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
  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...


EasyCFM.COM ColdFusion Forums : http://archive.easycfm.com/forums
Topic: http://archive.easycfm.com/forums/viewmessages.cfm?Forum=12&Topic=34