All source code in ColdFusion Ask a ColdFusion Pro Discussion Forum Categories All jobs in ColdFusion
CSV,HTML,Output,excel,file,easy,with,ColdFusi
   Code/Articles » |  Newest/Best » |  Community » |  Jobs » |  Other » |  Goto » | 
CategoriesSearch Newest CodeCoding ContestCode of the DayAsk A ProJobsUpload
ColdFusion Stats

 Code: 9,671. lines
 Jobs: 32. postings

 How to support the site

 
Sponsored by:
Quick Search for:  in language:    
You are in:
 
Login





Latest postings for ColdFusion.
Vat Number Format Checker
By aMUSICsite on 11/18


Click here to put this ticker on your site!


Add this ticker to your desktop!


Daily Code Email
To join the 'Code of the Day' Mailing List click here!



 
 
   

Query to MS Excel

Print
Email
 
article
Submitted on: 8/5/2008 4:25:48 PM
By: Tim Garver  
Level: Beginner
User Rating: By 4 Users
Compatibility:Cold Fusion MX

Users have accessed this article 21359 times.
 
author picture
(About the author)
 
     Output excel file easy with ColdFusion MX. Hi Many years ago i wrote an article here to create an excel CSV file with ColdFusion. I wanted to update this with the newer easier way to accomplish the same goal. have a search page with an output type drop box called "otype" values("web","xls","prt") Write out your page in an HTML table with the columns you want in excel. Then put an IF statement around your table or simply at the bottom of the page with links to the same page with the otype or a form that submits to the same page with the otype var. then use this code:

 
 
Terms of Agreement:   
By using this article, you agree to the following terms...   
1) You may use this article in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.   
2) You MAY NOT redistribute this article (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
3) You may link to this article from another website, but ONLY if it is not wrapped in a frame. 
4) You will abide by any additional copyright restrictions which the author may have placed in the article or article's description.
<cfif #form.otype# EQ "xls"> <cfheader name="Content-Type" value="application/msexcel"> <cfheader name="Content-Disposition" value="attachment; filename=MyReport.xls"> <cfelseif #form.otype# EQ "prt"> <cfheader name="Content-Type" value="application/msword"> <cfheader name="Content-Disposition" value="attachment; filename=MyReport.doc"> </cfif> Thats it, very simple and when the link is clicked or form is submited, the user will be asked to download the Excel file.


Other 11 submission(s) by this author

 

 
 Report Bad Submission
Use this form to notify us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:
 
Your Vote!

What do you think of this article(in the Beginner category)?
(The article with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor See Voting Log
 
Other User Comments
7/24/2008 5:22:10 AMquery to excell

gf
(If this comment was disrespectful, please report it.)

 
9/3/2008 3:43:11 PMomar

ingreso nuevo
(If this comment was disrespectful, please report it.)

 
11/8/2008 12:08:22 AMardhi

penting bgt niy.
(If this comment was disrespectful, please report it.)

 
2/11/2009 10:13:21 PMparesh

it is good
(If this comment was disrespectful, please report it.)

 
2/23/2009 11:22:16 PMsaeba

can give me same matery

(If this comment was disrespectful, please report it.)

 
8/10/2009 11:35:53 PMaaa

ffgefge
(If this comment was disrespectful, please report it.)

 
Add Your Feedback!
Note:Not only will your feedback be posted, but an email will be sent to the code's author from the email account you registered on the site, so you can correspond directly.

NOTICE: The author of this article has been kind enough to share it with you.  If you have a criticism, please state it politely or it will be deleted.

For feedback not related to this particular article, please click here.
 
To post feedback, first please login.


 

Categories | Articles and Tutorials | Advanced Search | Recommended Reading | Upload | Newest Code | Code of the Month | Code of the Day | All Time Hall of Fame | Coding Contest | Search for a job | Post a Job | Ask a Pro Discussion Forum | Live Chat | Games | Feedback | Customize | ColdFusion Home | Site Home | Other Sites | Open Letter from Moderators | About the Site | Feedback | Link to the Site | Awards | Advertising | Privacy

Copyright© 1997-2009 by Exhedra Solutions, Inc. All Rights Reserved.  By using this site you agree to its Terms and Conditions.   Planet Source Code (tm) and the phrase "Dream It. Code It" (tm) are trademarks of Exhedra Solutions, Inc.