Does anyone know if it's possible to send a CFCHART via CFMAIL? All kinds of people are asking this but no one seems to have an answer.... I tried modifying the example from the online docs to what's below (comments removed) but all I receive is an email with a red "x" in it and the 5 data records in a grid....
I did try writing everything to a CFSAVECONTENT variable too but with the same result....
Has anyone ever done this before? Is it possible? It seems pretty short sighted of Macromedia/Adobe to allow you to use these cool charts but not be able to convert them to .PDF or email them.... Or is there something I'm missing?
Code:
<cfquery name="GetSalaries" datasource="cfdocexamples">
SELECT Departmt.Dept_Name,
Employee.Dept_ID,
Employee.Salary
FROM Departmt, Employee
WHERE Departmt.Dept_ID = Employee.Dept_ID
</cfquery>
<cfquery dbtype = "query" name = "DataTable">
SELECT
Dept_Name,
AVG(Salary) AS avgSal,
SUM(Salary) AS sumSal
FROM GetSalaries
GROUP BY Dept_Name
</cfquery>
<cfloop index = "i" from = "1" to = "#DataTable.RecordCount#">
<cfset DataTable.sumSal[i] = Round(DataTable.sumSal[i]/1000)*1000>
<cfset DataTable.avgSal[i] = Round(DataTable.avgSal[i]/1000)*1000>
</cfloop>
<CFMAIL FROM="My Email Address"
TYPE="HTML"
TO="My Email Address"
SUBJECT="TEST">
<h1>Employee Salary Analysis</h1>
<cfchart format="jpg"
xaxistitle="Department"
yaxistitle="Salary Average"
show3D="yes">
<cfchartseries type="bar"
query="DataTable"
itemcolumn="Dept_Name"
valuecolumn="avgSal">
<cfchartdata item="Facilities" value="35000">
</cfchartseries>
</cfchart>
</cfmail>
I did try writing everything to a CFSAVECONTENT variable too but with the same result....
Has anyone ever done this before? Is it possible? It seems pretty short sighted of Macromedia/Adobe to allow you to use these cool charts but not be able to convert them to .PDF or email them.... Or is there something I'm missing?