for ($i = 0; $i < $nrows; $i++) { reset($results); $j = 0; while (list(, $column_value) = each($results)) { $data[$i][$j] = $column_value[$i]; $j++; } } } else { echo "No Records found"; } oci_free_statement($stmt); $title = 'List of equipment'; $pdf = new XFPDF(); $pdf->Open(); $pdf->SetFont('Arial', '', 10); $pdf->AddPage('P', '', 'A4'); $pdf->SetTitle($title); $pdf->FancyTable($header, $data); $pdf->Output("Report.pdf"); ?> <html> <head><title></title></head> <body> <?php $file = 'Report.pdf'; $filename = 'Report.pdf'; header('Content-type: application/pdf'); header('Content-Disposition: inline; filename="' . $filename . '"'); header('Content-Transfer-Encoding: binary');