enigment wrote:
So I tried this:

<cfsavecontent variable="sqlResult">
        <cfdocument format="pdf"><cfoutput>#sqlResult#</cfoutput></
cfdocument>
</cfsavecontent>
<cfheader name="Content-Disposition" value="attachment; filename=""sql
results.pdf""">
<cfcontent reset="yes" type="application/pdf; charset=UTF-8"
variable="#sqlResult#">

I think you may be overcomplicating this--if you use cfheader and you're outputting right on that page, you don't need cfcontent since you're generating the PDF on the fly. cfcontent comes in handy for forcing a download of files that have been written to disk, however.

This should do the trick--let's assume select * from foo gets me an id and email column:
<cfquery name="whatever">
select * from foo
</cfquery>

<cfheader name="Content-Disposition" value="attachment; filename=""sql results.pdf""" />

<cfdocument format="pdf">
    <cfoutput query="whatever">
        #whatever.id# #whatever.email#<br />
    </cfoutput>
</cfdocument>

Try running that and see if that does the trick, or let me know if I'm misunderstanding what you're trying to accomplish. I did a quick test and that worked for me.
--
Matthew Woodward
[email protected]
http://www.mattwoodward.com/blog

Please do not send me proprietary file formats such as Word, PowerPoint, etc. as attachments.
http://www.gnu.org/philosophy/no-word-attachments.html

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to