Jump to content

Convert to PDF when there is a swf file in the html page


Anush

Recommended Posts


I need to convert the following table and graph to PDF when button is clicked. Please help
I am using fusion charts and generated graph will be swf file

// Table and graph for all students
if(isset($_POST['ReportAll'])){
$strQuery = ("SELECT registration_number,SUM(Fine) AS Total_Fine
FROM lended_book_cd
GROUP BY registration_number");

$result=mysql_query($strQuery);
if (!$result){
Error (mysql_error()) ;
}
if (mysql_num_rows($result)!==0){

$table=1;
echo $input_table;
echo "<center>Fine report for All Students </center>";
echo "<br>";
echo "<table border='2' align='center'>";
echo("<tr>");
for($i=0;$i<mysql_num_fields($result);$i++){
echo("<th>".mysql_field_name($result,$i)."</th>");
}
while($data=mysql_fetch_array($result)){
echo("<tr>");
for($i=0;$i<mysql_num_fields($result);$i++){
echo("<td>".$data[$i]."</td>");
}
}
echo "</table>";
}
else{
Info ("No Fine Reports found for Student $_POST[regnum]");
}

$strQuery = ("SELECT registration_number,SUM(Fine) AS Total_Fine
FROM lended_book_cd
GROUP BY registration_number");
//Where lended_book_cd.registration_number = students.registration_number
$result=mysql_query($strQuery);
$strXML = "<graph caption='Fine report for All Students' showLabels='1' xAxisName='Student Registration Number' yAxisName='Fine Value' showNames='1' showValues='1' useRoundEdges='1' palette='3'>";

while($ors = mysql_fetch_array($result)) {

// Append the names of the countries and their respective populations to the chart's XML string.
$strXML .= "<set name='$ors[registration_number]' value='$ors[Total_Fine]' />";
}

$strXML .= "</graph>";

echo renderChart('charts/FCF_Column2D.swf', // Path to chart type
'', // Empty string when using Data String Method
$strXML, // Variable that contains XML string
'chart1Id', // Unique chart ID
'560', '400', // Width and height in pixels
false, // Disable debug mode
true // Enable 'Register with JavaScript' (Recommended)
);


}

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.