how do i print report in pdf format .................
Posted: Tue Dec 29, 2009 1:39 am
iam using the following script to print the report in pdf ...
<?php
include '../../db.php';
$Sname = $_SESSION['insid'];
require('mysql_report.php');
$pdf = new PDF('P','pt','A4');
$pdf->SetFont('Arial','',10.5);
$pdf->connect('localhost','root','admin','iiews');
$attr = array('titleFontSize'=>12, 'titleText'=>'Complete Course Students Report');
$sql="select *from studentregdtb where InstituteId='$Sname' and Approval='C'";
// echo $sql;
$rss=mysql_query($sql) or die (mysql_error());
$count = mysql_num_rows($rss);
while( $b=mysql_fetch_array($rss))
{
$sql="select RegdId,Name,FatherName,MotherName,(select DistrictName from Distt where Did='$b[District]') as District , (select BlockName from Block where BlockId='$b[Block]') as Block,Sex,Category,AddmissionDate from studentregdtb where Approval='C'";
//echo $sql;
$pdf->mysql_report($sql,false,$attr);
$pdf->Output();
}
?>
this script working fine but its print only last value.which is having District and Block
<?php
include '../../db.php';
$Sname = $_SESSION['insid'];
require('mysql_report.php');
$pdf = new PDF('P','pt','A4');
$pdf->SetFont('Arial','',10.5);
$pdf->connect('localhost','root','admin','iiews');
$attr = array('titleFontSize'=>12, 'titleText'=>'Complete Course Students Report');
$sql="select *from studentregdtb where InstituteId='$Sname' and Approval='C'";
// echo $sql;
$rss=mysql_query($sql) or die (mysql_error());
$count = mysql_num_rows($rss);
while( $b=mysql_fetch_array($rss))
{
$sql="select RegdId,Name,FatherName,MotherName,(select DistrictName from Distt where Did='$b[District]') as District , (select BlockName from Block where BlockId='$b[Block]') as Block,Sex,Category,AddmissionDate from studentregdtb where Approval='C'";
//echo $sql;
$pdf->mysql_report($sql,false,$attr);
$pdf->Output();
}
?>
this script working fine but its print only last value.which is having District and Block