I don't know if many on this list use the coldfusion report builder,
but if you are ever making any sort of advanced charts you have
probably noticed that you have some annoying limitations. For example
there is no way to dynamically go and create all your series.
However with cfchart (which is probably what the report builder is
using with just a gui interface) you can loop through a query and
create your series dynamically. Again, unfortunately there isn't any
way to just go in and put in a cfchart tag into the repor builder.
So here is the solution we have come up with, anyone with any
suggestions or ideas is welcome to contribute.
Step 1: Create a function named createChart in the report builder
Step 2: Write this function and place your own query in (or set it up
however you would a normal cfchart)
<cfsavecontent variable="chartPath">
<cfquery name="chartSeries" datasource="BLAH">
*your query*
</cfquery>
<cfchart format="png"
xaxistitle="Department"
show3d = "Yes" yaxistitle="Salary Average" chartwidth="600"
chartheight="500">
<cfchartseries type="pie"
query="chartSeries"
itemcolumn="MaintProdDesc"
valuecolumn="Count_TypeName">
</cfchartseries>
</cfchart>
</cfsavecontent>
<cfset fullImagePath = "http://" & cgi.http_host & mid(trim
(chartPath),find("/CFIDE",trim(chartPath)),(find(".PNG",trim
(chartPath))-find("SRC",trim(chartPath)))-1)>
<cfreturn fullImagePath>
Step 5: Simply create an image on the report builder and set it's
expression to equal report.createChart()
In case anyone doesn't see what's going on here, all that is
occurring is that we are going and telling coldfusion to create a png
chart, getting the path, and returning it as the path of the image,
thus making the chart appear in there.
Hope this is useful to someone,
Kenton
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking
application. Start tracking and documenting hours spent on a project or with a
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:209883
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54