|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Results of Query In Ms-Excel
Hi, After we query the data from the query, i want the results to be projected in MS-Excel which opens up in browser! How do we do this? Can Anyone Help? ~SweetMoon~ |
|
#2
|
|||
|
|||
|
Yo can export to excell in the following way,
1. get the details, <CFQUERY NAME="qry1" DATASOURCE="#Application.DS#" username="#Application.User#" password="#Application.PW#"> Select field1, field2 From table1 </CFQUERY> 2. Set the fromat you want to appear in the excel sheet, <!--- set variables for special characters ---> <cfset TabChar = Chr(9)> <cfset NewLine = Chr(13) & Chr(10)> <cfset f_name = "filename.xls"> <!--- set content type to invoke Excel ---> <cfcontent type="application/msexcel"> <cfheader name="Content-Disposition" value="filename=#f_name#"> <cfoutput>fieldName1#TabChar#Fieldname2#NewLine#</cfoutput> <cfloop query="qry1"> <cfoutput>#field1##TabChar##field2##NewLine#</cfoutput> </cfloop> <cfabort> try this this will work for u, I guess. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > Cold Fusion Development > query results in Excel |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|