Couple of Projects that I am working on required to download the data from database in Excel fromat, so that the client can download it on his local system.
One of the efficient way I have found is using Query2Excel Tag which is available FREE on internet. You can download if from www.cflib.org
Below code is just how to call that function, for excel download.
<!--- Query to get information from database --->
<cfquery name="get_info" datasource="#whatever#">
select name1, name2, name3 from yourdatabase
<!--- give the column names and headers for Excel file --->
cols = "name1, name2, name3";
heads = "Name1, Name2, Name3"
<!--- use CFHEADER tag --->
<cfheader name="Content-Disposition" value="inline; filename=data.xls">
<!--- output the results using the query2excel function --->
<cfoutput> #Query2Excel(get_info, heads, cols)# </cfoutput>
<!--- End of code --->
That's all you need :-)
Thursday, July 5, 2007
How to Output Query In Excel Format Using Coldfusion MX
Subscribe to: Post Comments (Atom)
- ► 2009 (15)
- Searching on Google, Really Cool stuff !!!!!
- Jazz, Two Months Old !!!!!!
- FRIENDS All Seasons Download Links !!!!!!!!
- Output Query To CSV file using Coldfusion MX and J...
- How to Parse XML using Coldfusion MX
- How to Output Query In Excel Format Using Coldfusi...
- SQL Server Interview Questions
- ASP.Net Interview Questions
- ▼ July (8)
Post a Comment