Page 1 of 1

how do i print report in pdf format .................

Posted: Tue Dec 29, 2009 1:39 am
by manojsemwal1
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

Re: how do i print report in pdf format .................

Posted: Tue Dec 29, 2009 8:26 am
by bjazmoore
What does your query return when the data is dumped out raw?

Re: how do i print report in pdf format .................

Posted: Wed Dec 30, 2009 7:54 am
by manojsemwal1
in the jpg image the result is displaying but in that column Block chakrata is displyaing two time while it is diffrent block.