Skip to main content
Inspiring
June 1, 2009
Question

cfdocument CF8

  • June 1, 2009
  • 1 reply
  • 1571 views

I'm creating a report using the cfdocument with CF8

Everything works just fine, I can see my report in the form of pdf using the codes below the problem is that the pdf overwrite my page, what I need is a separate page when the pdf is generated.

I need something like targe="_blank" attribute of the HREF in html where a separate windows/page pop up seperately from the original windows.

Is there attribute of cfdocument that will produce such a thing? I tried overwrite="false" did not work, I tried localurl="no" did not work I guess I just don't know which attribute to use.

Any help is very much appreciated

<cfdocument format="pdf" filename="annualreport.pdf" orientation="landscape" localUrl = "no" overwrite="true">

<table border="0" width="100%" cellspacing="2" cellpadding="1">

<tr><td colspan="12" align="center"><font color="b70000"><b>Report name goes here</b></font>

</td></tr>

My report codes goes here

</table>

</cfdocument>

<cflocation url="annualreport.pdf" addtoken="false">

This topic has been closed for replies.

1 reply

June 1, 2009

How do you trigger your pdf report?

If you open it using a hyperlink then there is nothing stopping you from using <a href=report.cfm target="_blank">the URL</a> .. is there?

You could also launch the PDF by using the a html submit button and some javascript to open it in a new window.

If I understand you right then I dont think you can open the PDF in a new window by adding any attributes to the CFDOCUMENT tag.

I think becuase the coldfusion tags and attributes are server side.

You need to use client side code (like javascript or html) to launch the new window which then instantiates the server side code.