MACROMEDIA COLDFUSION 5-DEVELOPING Develop Manual page 99

Table of Contents

Advertisement

Linking Dynamically from Graphs
Reviewing the code
The following table describes the code and its function:
Code
<cfquery name="GetSalaryDetails"
</cfquery>
<table border cellspacing=0 cellpadding=5>
<tr>
</tr>
<cfoutput query="GetSalaryDetails" >
<tr>
</tr>
</cfoutput>
</table>
Part 2: Making the graph dynamic
1
2
datasource="CompanyInfo">
SELECT
Departmt.Dept_Name,
Employee.FirstName,
Employee.LastName,
Employee.StartDate,
Employee.Salary,
Employee.Contract
FROM Departmt, Employee
WHERE
Departmt.Dept_Name =
'#URL.Dept_Name#'
AND Departmt.Dept_ID =
Employee.Dept_ID
ORDER BY Employee.LastName,
Employee.Firstname
<th>Employee Name</td>
<th>StartDate</td>
<th>Salary</td>
<th>Contract?</td>
<td>#FirstName# #LastName#</td>
<td>#dateFormat(StartDate,
"mm/dd/yyyy")#</td>
<td>#numberFormat(Salary, "$999,999")#</td>
<td>#Contract#</td>
Open graphdata.cfm in ColdFusion Studio.
Edit the
tag for the pie chart so it appears as follows:
cfgraph
<cfgraph type="pie"
query="DeptSalaries"
valueColumn="SumByDept"
itemColumn="Dept_Name"
URL="Salary_Details.cfm?Dept_Name="
URLColumn="Dept_Name"
Description
Get the salary data for the
department whose name
was passed in the URL
parameter string. Sort the
data by the employee's last
and first names.
Display the data retrieved
by the query as a table.
Format the start date into
standard month/date/year
format, and format the
salary with a leading dollar
sign comma separator, and
no decimal places.
79

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 5

Table of Contents