[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Query Results to a DoC File

Posted on 2009-12-16
1
Medium Priority
?
259 Views
Last Modified: 2013-12-24
My query is i have results of ysers table and i want them to export to the word Document DOC file. I searched google a bunch and here at experts echange too but did not found a solid solution which should works for me.

i tried one solution listed here:
<cfheader name="content-disposition" value="inline;filename=AccessToDoc.doc">
      <cfcontent type="application/msword">
      <table border="1">
     <tr>
          <th>First Name</th>
          <th>Last Name</th>
          <th>Email Address</th>
     </tr>
       <cfoutput query="endUsers">
     <tr>
          <td>#endUsers.firstname#</td>
          <td>#endUsers.lastname#</td>
          <td>#endUsers.emailaddress#</td>
     </tr>
       </cfoutput>
      </table>

But useless, it displayed my whole lot page inside it
0
Comment
1 Comment
 
LVL 36

Accepted Solution

by:
SidFishes earned 2000 total points
ID: 26067234
try it this way


<cfsavecontent variable="docfile">
    <table border="1">
     <tr>
          <th>First Name</th>
          <th>Last Name</th>
          <th>Email Address</th>
     </tr>
       <cfoutput query="endUsers">
     <tr>
          <td>#endUsers.firstname#</td>
          <td>#endUsers.lastname#</td>
          <td>#endUsers.emailaddress#</td>
     </tr>
       </cfoutput>
      </table>
</cfsavecontent>

<cfheader name="content-disposition" value="inline;filename=AccessToDoc.doc">
      <cfcontent type="application/msword" >
<cfoutput>#docfile#</cfoutput>
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When setting up new project requests for our site, one of the most powerful tools our team has available to use is Axure (http://www.axure.com/). It’s a tool for creating software and web prototypes that can function and interact as if it were the a…
Geo-targeting is the practice of distributing content based on a person’s location, as best as you can determine it. Let’s look at some ways you could successfully use this tactic. The following tips and case studies could lead to meaningful results.
The purpose of this video is to demonstrate how to Import and export files in WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Click on Too…
The purpose of this video is to demonstrate how to set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…
Suggested Courses
Course of the Month19 days, 7 hours left to enroll

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question