• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 160
  • Last Modified:

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
0
asamuel
Asked:
asamuel
  • 5
  • 2
2 Solutions
 
pinaldaveCommented:
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
How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

 
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

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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.

  • 5
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now