hi friend , m facing problem to generate pdf file. i m using following code:-
if(isset($_POST['pro']))
{
include "common.php";// for db conectivity
$tablename="rentsum";
$sql = "Select empcode,ticket_no,ctgcode,empname,allot_dt,to_char(qtrno) qtrno,type,seccode,wt,lf,'0' arr ,CONSERV con,met_chg,'0' eu from $tablename where MONTH='$month' AND YEAR='$year' and type not in ('4','5','0') order by qtrno ";
$result =oci_parse($conn,$sql);
oci_execute($result);
$filename="hrent.pdf";
header("Content-type: application/pdf");
header("Content-disposition: pdf" . date("Y-m-d") . ".pdf");
//header("Content-disposition: attachment;filename=$filename");
while($result=oci_fetch_array($sqldata,OCI_BOTH))
{
$empcode=$result['EMPCODE'];
echo $empcode."\r\n";
}
}
but it is not working. means pdf flie is generate but when im open the file it show error nmassage the this file is in damage format. plz help me that