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

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
manojsemwal1
Forum Contributor
Posts: 217
Joined: Mon Jun 29, 2009 4:13 am
Location: India

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

Post 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
Attachments
screen.JPG
screen.JPG (55.07 KiB) Viewed 530 times
bjazmoore
Forum Newbie
Posts: 11
Joined: Mon Dec 28, 2009 12:12 pm

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

Post by bjazmoore »

What does your query return when the data is dumped out raw?
manojsemwal1
Forum Contributor
Posts: 217
Joined: Mon Jun 29, 2009 4:13 am
Location: India

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

Post 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.
Post Reply