Glad to help! The trick seems to be that you have to save the chart to an image that the java function that makes the PDF can pull, things created on the fly that can't be pulled apparently don't show up. JPG isn't the best quality but you could easily change it to PNG, or use another solution if you don't like cfchart, as long as you save an image it should work.
On Friday, February 22, 2013 10:54:53 AM UTC-6, [email protected] wrote: > > Beautiful!! Thanks very much. Much cleaner than using JavaScript and > printing to the PDF writer. > > On Thursday, February 21, 2013 12:08:14 AM UTC-8, Marcus F wrote: >> >> And as it turns out I have no idea how to put the code in those nice >> blocks, so you get a "quote block" instead :P >> >> On Thursday, February 21, 2013 2:06:46 AM UTC-6, Marcus F wrote: >>> >>> Here's a quick proof of concept using cfchart that works. >>> It creates a jpg, saves it to a temporary folder, displays it using <img >>> src="">, creates the pdf, and deletes the temporary jpg. >>> >>> <cfprocessingdirective suppressWhitespace="true"> >>>> <cfset destination = expandPath("test")> >>>> <cfchart name="myChart" format="jpg"> >>>> <cfchartseries type="pie"> >>>> <cfchartdata item="New Vehicle Sales" value=500000> >>>> <cfchartdata item="Used Vehicle Sales" value=250000> >>>> <cfchartdata item="Leasing" value=300000> >>>> <cfchartdata item="Service" value=400000> >>>> </cfchartseries> >>>> </cfchart> >>>> >>>> <cffile action="write" file="#destination#/tmp.jpg" >>>> output="#myChart#"> >>>> <cfdocument format="pdf" filename="#destination#/myChart.pdf" >>>> overwrite="Yes"> >>>> <html> >>>> <head> >>>> <title>Chart test</title> >>>> </head> >>>> >>>> <body> >>>> <img src="test/tmp.jpg"> >>>> </body> >>>> >>>> </html> >>>> </cfdocument> >>>> <cffile action="delete" file="#destination#/tmp.jpg"> >>>> </cfprocessingdirective> >>>> >>> -- -- online documentation: http://openbd.org/manual/ http://groups.google.com/group/openbd?hl=en --- You received this message because you are subscribed to the Google Groups "Open BlueDragon" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
