php report in Excel format

Posted: April 7, 2010 in PHP Stuff
Tags: , ,
<a href="ExcelSheetReport.xls”> [Download Report In Excel]


$str=”

S. No.

“;

Generate_ExcelReport($str);

function Generate_ExcelReport($htmlFile)
{
echo(”
“);

@session_start();
$sess_id=session_id();

$File_name=”ExcelSheetReport”.$sess_id.”.xls”;
//*************If File is already exist then delete from server
if(file_exists($File_name))
{
unlink($File_name);
}
///////////////////////////////////////////////////////////////
// echo(“
file name is “.$htmlFile); exit;
$handle=fopen($File_name,”w”);
fwrite($handle,$htmlFile);
fclose($handle);

unset($htmlFile);
// ob_flush(); //totka 1
// clearstatcache(); //totka 2
// Header(“Cache-Control: No-cache, Must-revalidate”); //totka 3

//session_destroy();

# require(“pdf/html2fpdf.php”);
# $pdf = new HTML2FPDF(‘L’, ‘mm’, ‘A4’);
# $pdf->AddPage();
# $pdf->WriteHTML($htmlFile);
# $pdf->Output(‘ExamSectionReport.pdf’, ‘F’);
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s