Exporting data from database

There is any way to export data to excel format or word format or any other format
so user when click on button open the save window for them and ask them which format
they want
asamuelAsked:
Who is Participating?
 
pinaldaveConnect With a Mentor Commented:
hi,
Following example is for the excel data. you can use the word similarly just changing them to word or excel.

 <cfquery datasource="MyDataSourceHere" name="qryAccessData">
     SELECT Field1, Field2, FieldN
          FROM AccessTable
</cfquery>
<cfheader name="content-disposition" value="inline;filename=AccessToExcelDump.xls">
<cfcontent type="application/msexcel">
<table border="1">
     <tr>
          <th>Field1</th>
          <th>Field2</th>
          <th>FieldN</th>
     </tr><cfoutput query="qryAccessData">
     <tr>
          <td>#qryAccessData.Field1#</td>
          <td>#qryAccessData.Field2#</td>
          <td>#qryAccessData.FieldN#</td>
     </tr></cfoutput>
</table>

Also what you can do is that. You can create the link where user can download their required format.

Regards,
---Pinal

0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
pinaldaveCommented:
split Trail and pinaldave IMHO
0
 
trailblazzyr55Commented:
awaiting feedback ;o)
0
 
trailblazzyr55Commented:
agree with pinaldave ;o)
0
 
trailblazzyr55Commented:
I think between what pinaldave and I posted there is a solution, if not both being a solution to the question... I agree to split, should asamuel not want to keep this open for further help ;o)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.