Hi Kenton,

Your idea really saved me tonight. The only reason I was even trying to use the 
Report Builder (which to me seems to be worth what it costs) was to overcome 
the limitation that you can't use CFChart within CFDocument. However, I was 
finding Report Builder incredibly frustrating.

But your plan spurred me to do the following: First create my chart and save it 
as a PNG using CFFile. Then I call the image using the regular HTML img tag 
within the CFDocument tag. More cumbersome than it should be, but it works 
great.

Thanks very much.

- Rocky


>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

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create robust enterprise, web RIAs.
Upgrade & integrate Adobe Coldfusion MX7 with Flex 2
http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:264287
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to