#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2011
    Posts
    58
    Rep Power
    4

    ColdFusion 8:How can I get the values from other cold fusion files


    Please consider the following code:

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>PieChart</title>
    </head>
    
    <body>
    <div align="center">
    <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
    <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
    <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
    <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
    <h1> Email Reporting Analysis </h1>
    
    <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
    
    <cfchart
             format="png"
             scalefrom="0"
             scaleto="1200000"
             pieslicestyle="solid">
    	<cfchartseries
    	             type="pie"
    	             serieslabel="Website Traffic 2006"
    	             seriescolor="blue">
    		<cfchartdata item="% OPEN" value="30">
    		<cfchartdata item="%DROPPED" value="1">
    		<cfchartdata item="% PROCESSED" value="20">
    		<cfchartdata item="% BOUNCE" value="1">
    		<cfchartdata item="% DELIVERED" value="17">
    		<cfchartdata item="% DEFERRED" value="31">
    	</cfchartseries>
    </cfchart>
    
    </div>
    </body>
    </html>
    The above file name is "PieChart.cfm"

    In the above code, I have hard coded the values (30,1,20,1,17,31). However, I have other coldfusion files with me for example (Count_Open.cfm which has SQL statement inside it and the file is returning the value of % OPEN , similar is the case with other files as well, namely, Count_Dropped.cfm,Count_Delivered.cfm rtc )

    How can I use the values returned by above files in my file `PieChart.cfm' so that if the data keeps on changing, I don't have to run the files again and again and hard code the values.

    Please help and let me know if my questions is not clear.

    Thanks
  2. #2
  3. No Profile Picture
    Moderator

    Join Date
    Jun 2002
    Location
    Raleigh, NC
    Posts
    5,278
    Rep Power
    968
    Use a variable, e.g.:

    <cfchartdata item="% OPEN" value="#percentOpen#">
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2011
    Posts
    58
    Rep Power
    4
    Originally Posted by kiteless
    Use a variable, e.g.:

    <cfchartdata item="% OPEN" value="#percentOpen#">
    Thanks, it worked.

IMN logo majestic logo threadwatch logo seochat tools logo