House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  ColdFusion Talk (CF-Talk)

Using ColdFusion variable in cfdocument filename

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Hello everyone,
Dirk Dinnewet
07/03/08 08:37 A
Yep ;)
Dominic Watson
07/03/08 08:51 A
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Dirk Dinnewet
07/03/2008 08:37 AM

Hello everyone, Maybe it's obvious, but I'd like to include the #URL.klopper# variable in my filename atribute when using cfdocument, so as to generate a document for this specific page. (Pseudo) could would be something like filename="c:\<cfoutput>#klopper#</cfoutput>.pdf" Is this doable ? Fyi I'm using MX7 not CF8 so, filesaveas is not (yet) an option. Regards, Dirk ---------------------------------------------------------------------- <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>; <html> <head> <cfset klopper = #URL.klopper#> <cfset slachtdatum = #URL.slachtdatum#> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <cfdocument format="pdf" backgroundvisible="yes" unit="cm" fontembed="yes" filename="c:\slachtresultaten.pdf" overwrite="yes"> <cfinclude template="leveringen_detail_print.cfm"> </cfdocument> </head> <body> </body> </html> <cfdump var="#klopper#"> ------------------------------------------------------------------------------

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Dominic Watson
07/03/2008 08:51 AM

Yep ;) <cfset VARIABLES.klopper = URL.klopper> <cfset VARIABLES.slachtdatum = URL.slachtdatum> <cfset VARIABLES.dateiname = "C:\#URL.klopper#.pdf"> <cfdocument format="pdf" backgroundvisible="yes" unit="cm" fontembed="yes" filename="#VARIABLES.dateiname#" overwrite="yes">      <cfinclude template="leveringen_detail_print.cfm"> </cfdocument> Have a search for tutorials on using variables in ColdFusion; there are several ways to do this and they are all fundamental to programming in CF (the problem is very easy when you have a solid understanding of how CF uses variables). HTH (and that dateiname = filename, my German sucksen) Dominic -- Blog it up: http://fusion.dominicwatson.co.uk

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Dirk Dinnewet
07/04/2008 05:10 AM

Dominic, thanks for the quick and concise answer. One learns every day. ----- Excess quoted text cut - see Original Post for more -----


<< Previous Thread Today's Threads Next Thread >>

Search cf-talk

May 24, 2012

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
     1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31     

Designer, Developer and mobile workflow conference