is there anyone here who could help me how to embed an excel file in php or even in html?
i've used iframe but i didn't get the right result i wanted..
could you please enlighten me?
im waiting for your suggestions!
thanks!
Moderator: General Moderators
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
some hints, hope it helpsCode: Select all
//beginning of the report string
$report_str = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-type" content="text/html;charset=utf-8" />
<style id="Classeur1_16681_Styles">
</style>
</head>
<body>
<div id="Classeur1_16681" align=center x:publishsource="Excel">
<table x:str border=0 cellpadding=0 cellspacing=0 width=100% style="border-collapse: collapse">
';
//now, the report header
$report_str .= "<tr>";
foreach($reportheader as $header){
$report_str .= "<td><b>$header</b></td>";
}
$report_str .= "</tr>";
//now, the report data
foreach($reportdata as $data){
$report_str .= "<tr>";
foreach($data as $datacell){
$report_str .= "<td>$datacell</td>";
}
$report_str .= "</tr>";
}
//end of the report string
$report_str .= '
</table>
</div>
</body>
</html>
';
header("Content-type: application/vnd.ms-excel");
header("Content-Disposition: attachment; filename=myreport.xls");
print $report_str;Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]