I tried embedding a sample Google chart into my CFML code and still won't
show up in the PDF output. Here's my code, and any help to resolve this
would be greatly appreciated (I'm doing everything I can to not give up on
OpenBD, as I think it is a great project, but may have to scrap the whole
ColdFusion portion of the app if it can't do the one thing it was brought
on to do, e.g., create PostScript / PDF outputs without too much hassle).
<cfsavecontent variable="rendered_report" attributecollection="true"> <!---
Have also tried surrounding the HTML tags with cfoutput, but a big FAIL! --->
<html>
<head>
<!--Load the AJAX API-->
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
// Load the Visualization API and the piechart package.
google.load('visualization', '1.0', {'packages':['corechart']});
// Set a callback to run when the Google Visualization API is loaded.
google.setOnLoadCallback(drawChart);
// Callback that creates and populates a data table,
// instantiates the pie chart, passes in the data and
// draws it.
function drawChart() {
// Create the data table.
var data = new google.visualization.DataTable();
data.addColumn('string', 'Type of Shit');
data.addColumn('number', 'Amount');
data.addRows([
['Constipation Bricks', 3],
['Diarrhea', 1],
['Sharts', 1],
['Soft Serve Choco', 1],
['Floaters', 2]
]);
// Set chart options
var options = {'title':'How Much Shit I Have to Go Through to Make This
Work',
'width':400,
'height':300};
// Instantiate and draw our chart, passing in some options.
var chart = new
google.visualization.PieChart(document.getElementById('chart_div'));
chart.draw(data, options);
}
</script>
</head>
<body>
<!--Div that will hold the pie chart-->
<div id="chart_div"></div>
</body>
</html>
<cfdocument format="PDF" filename="report.pdf" overwrite="Yes"
orientation="landscape" marginbottom="0.5" margintop="0.5">
<cfoutput>
<div id="chart_div"></div> <!--- This line should not be necessary
here, but even this doesn't work --->
#rendered_report#
</cfoutput>
</cfdocument>
<cfheader name="Content-Disposition" value="attachment;filename=report.pdf">
<cfcontent type="application/octet-stream" file="report.pdf" deletefile="Yes">
<!--- Epic fail! PDF is blank. --->
--
--
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.