怎样把数据导出为Excel文件?

19840701 2004-01-08 02:37:38
只要导出的每个字段的值后面加制表符就可以了
但是具体不会

各位帮忙
...全文
119 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
felio 2004-08-16
  • 打赏
  • 举报
回复
陪你去看海的不错,THX~~~~~~~~~~~~~~~~~~~~
phpcool 2004-01-08
  • 打赏
  • 举报
回复
http://www.181info.com/number.php
mikespook 2004-01-08
  • 打赏
  • 举报
回复
cu上的一篇讨论

php将mysql数数导成EXCEL文档
http://bbs.chinaunix.net/forum/viewtopic.php?t=172598

希望对你有帮助~~~

传说微软将公布EXCEL的XML格式
http://bbs.chinaunix.net/forum/viewtopic.php?t=204738

bonniewater 2004-01-08
  • 打赏
  • 举报
回复
<?php
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>
chmask 2004-01-08
  • 打赏
  • 举报
回复
不懂你要问什么。从什么数据库里向外导?什么只要制表符就可以了?
jxyuhua 2004-01-08
  • 打赏
  • 举报
回复
将数据读出,然后输出为EXCEL格式的文件

21,891

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧