怎样把数据导出为Excel文件? 将数据读出,然后输出为EXCEL格式的文件 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <?phpheader("Content-type:application/vnd.ms-excel");header("Content-Disposition:filename=test.xls");?><html><head><meta http-equiv=Content-Type content="text/html; charset=GB2312"><style><!--.xl24 {font-size:20.0pt; font-family:楷体_GB2312, monospace; text-align:center; vertical-align:middle; white-space:normal;}.xl25 {text-align:center; vertical-align:middle; border:.5pt solid windowtext; white-space:normal;}.xl26 {vertical-align:middle; border:.5pt solid windowtext; white-space:normal;}.xl27 {text-align:center; vertical-align:middle; border:.5pt solid windowtext; white-space:normal;}.xl28 {font-family:黑体; text-align:center; vertical-align:middle; border:.5pt solid windowtext; white-space:normal;}.xl29 {text-align:left; vertical-align:middle; border:.5pt solid windowtext; white-space:normal;}--></style></head><body bgcolor="#FFFFFF"><table x:str border=0 cellpadding=0 cellspacing=0 width=960> <tr height=50> <td colspan=8 height=50 class=xl24 width=960>() 至 () 收费统计分析</td> </tr> <tr height=30> <td class=xl28 height=30 width=60>序号</td> <td class=xl28 width=300>客户名称</td> <td class=xl28 width=100>收费项目</td> <td class=xl28 width=120>金额</td> <td class=xl28 width=100>方式</td> <td class=xl28 width=120>完成时间</td> <td class=xl28 width=80>状态</td> <td class=xl28 width=80>业务员</td> </tr><?phpFor($I = 1;$I < 10 ;$I++){?> <tr height=30> <td height=30 class=xl25 width=60 x:num><?=$I?></td> <td class=xl26 width=300>a</td> <td class=xl25 width=100>b</td> <td class=xl26 width=120>c</td> <td class=xl25 width=100>d</td> <td class=xl29 width=120>e</td> <td class=xl27 width=80>f</td> <td class=xl25 width=80x:num>g</td> </tr><?php} ?> <tr height=26> <td height=26 class=xl28>合计</td> <td colspan='2' class=xl26>元</td> <td height=26 class=xl28>制表时间</td> <td colspan='2' class=xl26></td> <td height=26 class=xl28>制表人</td> <td class=xl26></td> </tr></table></body></html> cu上的一篇讨论php将mysql数数导成EXCEL文档http://bbs.chinaunix.net/forum/viewtopic.php?t=172598希望对你有帮助~~~传说微软将公布EXCEL的XML格式http://bbs.chinaunix.net/forum/viewtopic.php?t=204738 请问大家,怎么修改上传的文件命名???? 再求个正则表达式 php request 网页中文出现乱码 PHP5 + Sqlite + PDO 造就的 http://www.biho.com.cn 请教高手~~~~!!!! php 连接 sqlserver 问题 知道文件在网站的目录存放地址,怎样才能得到php源文件呢? 代码出错,请高手看看! 字符替换问题 phpmyadmin运行出错,mysqli_init(): Property access is not allowed yet 求解决啊 WIN2000下PHP如何使用JPG图片文件?? get传值时遇到麻烦,请大侠帮忙?
header("Content-type:application/vnd.ms-excel");
header("Content-Disposition:filename=test.xls");
?>
<html>
<head>
<meta http-equiv=Content-Type content="text/html; charset=GB2312">
<style>
<!--
.xl24
{font-size:20.0pt;
font-family:楷体_GB2312, monospace;
text-align:center;
vertical-align:middle;
white-space:normal;}
.xl25
{text-align:center;
vertical-align:middle;
border:.5pt solid windowtext;
white-space:normal;}
.xl26
{vertical-align:middle;
border:.5pt solid windowtext;
white-space:normal;}
.xl27
{text-align:center;
vertical-align:middle;
border:.5pt solid windowtext;
white-space:normal;}
.xl28
{font-family:黑体;
text-align:center;
vertical-align:middle;
border:.5pt solid windowtext;
white-space:normal;}
.xl29
{text-align:left;
vertical-align:middle;
border:.5pt solid windowtext;
white-space:normal;}
-->
</style>
</head>
<body bgcolor="#FFFFFF">
<table x:str border=0 cellpadding=0 cellspacing=0 width=960>
<tr height=50>
<td colspan=8 height=50 class=xl24 width=960>() 至 ()
收费统计分析</td>
</tr>
<tr height=30>
<td class=xl28 height=30 width=60>序号</td>
<td class=xl28 width=300>客户名称</td>
<td class=xl28 width=100>收费项目</td>
<td class=xl28 width=120>金额</td>
<td class=xl28 width=100>方式</td>
<td class=xl28 width=120>完成时间</td>
<td class=xl28 width=80>状态</td>
<td class=xl28 width=80>业务员</td>
</tr>
<?php
For($I = 1;$I < 10 ;$I++)
{
?>
<tr height=30>
<td height=30 class=xl25 width=60 x:num><?=$I?></td>
<td class=xl26 width=300>a</td>
<td class=xl25 width=100>b</td>
<td class=xl26 width=120>c</td>
<td class=xl25 width=100>d</td>
<td class=xl29 width=120>e</td>
<td class=xl27 width=80>f</td>
<td class=xl25 width=80x:num>g</td>
</tr>
<?php
}
?>
<tr height=26>
<td height=26 class=xl28>合计</td>
<td colspan='2' class=xl26>元</td>
<td height=26 class=xl28>制表时间</td>
<td colspan='2' class=xl26></td>
<td height=26 class=xl28>制表人</td>
<td class=xl26></td>
</tr>
</table>
</body>
</html>
http://bbs.chinaunix.net/forum/viewtopic.php?t=172598希望对你有帮助~~~传说微软将公布EXCEL的XML格式
http://bbs.chinaunix.net/forum/viewtopic.php?t=204738