hei friends i need to create a report in pdf using the php. i need to open a table in the pdf when i am clicking a button using the php code.

how can i do this.. please help me.

$details=getAllExamid($classID);
if(count($details)!=0)
{
?>
		  <label class="boxtitle"><?php addHeading1($orgname[0]); ?></label>
		  <?php opentable(); 
		  ?>	
		  <form>		
		  <table width="77%" border="0" align="center" class="myTable">
          <label class="boxtitle" style="position:static "> Organization Name: <?php echo $orgname[0]; ?></label>
          <label class="boxtitle" style="position:static "> School Name: <?php echo $schname[0]; ?></label>
          <label class="boxtitle" style="position:static "> Class Name: <?php echo $clsname[0]; ?></label>
		  <tr>
            <th align="center">Exam Id</th>
            <th align="center">Student Id</th>
			<th align="center">Student Name</th>
			<th align="center">DOB</th>
			<th align="center">State</th>
			<th align="center">Country</th>
			<th align="center">Phone Number</th>
          </tr>
		  <?php
          foreach($details as $vals)
          { ?>
		    <tr> 
            <td align="center"><?php echo $vals[0];?></td>
            <td align="center"><?php echo $vals[1]; ?></td>
			<td align="center"><?php echo $vals[2];?></td>
            <td align="center"><?php echo $vals[3]; ?></td>
		    <td align="center"><?php echo $vals[4];?></td>
            <td align="center"><?php echo $vals[5]; ?></td>
		    <td align="center"><?php echo $vals[6]; ?></td> 
		<?php }//foreach ends here.
		  ?> </tr>
      </table>
	  <br>
	 <input name="print" type="submit" id="print" value="Print" align="middle">
	 </form>
<?php closetable(); 

} //  Inner if ends here. 

else
{
	ErrorDisplay("No File is Found ",getCurrentScriptName());
}
}
?>

i need to open the table in a pdf file when the print button ill click.
please give some ideas...

a v vishnu

    Write a Reply...