is_supported($_GET['type'])){ //if it's a supported filetype $report->s_filetype($_GET['type']); }else{ $report->s_filetype($report->g_default()); //else use the default filetype } $report->s_baseDir('site/'); // use this to specify the directory where the report template fit inside. $report->s_fileName('report.pdf.tpl'); $projectId = $db->sqlsafe($_GET['id']); $getData = $db->select('select id , name from projects_info where id='.$projectId.''); list($width , $height) = getimagesize($config['url'].'/cache/gantt.jpg'); $report->assign('config',$config); $report->assign('project',$getData[0]); $report->assign('width',$width); $report->addPage(); $filename = str_replace(' ','-',$getData[0]['name']); //set the filename here $report->printReport($filename); ?>