PHP生成 excl、word文件
$time = time();
$filename = date("Y年m月d日h点m分s秒", $time).'问卷数据';
$rows = Sp_Looks_Vote::downvote();
$file = $filename.".csv";
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.basename($file));
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
$tabletitle .= "购买地址,常常购买,喜欢模特,内容如何,印象如何,是否购买,感觉如何,购买方式,购买方式建议,吸引点,改进建议";
$conter = iconv('utf-8','gbk',$tabletitle)."\n";
echo $conter;die;
顺便把简单导出word文档的代码贴到这里:
<?php
header("Content-Type: application/msword");
header("Content-Disposition: attachment; filename=doc.doc");
header("Pragma: no-cache");
header("Expires: 0");
$output = '<table border="1" cellspacing="2" cellpadding="2" width="90%" align="center">';
$output .= '<tr bgcolor="#cccccc"><td align="center">图片</td></tr>';
$output .= '<tr bgcolor="#f6f7fa"><td><span style="color:#FF0000;"><strong>下面是一张图片</strong></span& gt;</td></tr>';
$output .= '<tr><td align="center"><img src="http://zi.csdn.net/48260_2.gif"></td></tr>';
$output .= '</table>';
echo $output;
?>
PHP生成 excl、word文件的更多相关文章
- 吴裕雄--天生自然python学习笔记:python文档操作自动生成菜单 Word 文件
许多学校营养午餐的菜单是由教师来轮流制作 ,这是一个 比较烦锁的工作,如 果能自动用教师最熟悉的 Word 文件来生成一个菜单文件,使教师对生成的菜单稍作 修改即可使用,那将是一个不错的主意. 案例要 ...
- 使用NPOI按照word模板文件生成新的word文件
/// <summary> /// 按照word模板文件 生成新word文件 /// </summary> /// <param name="tempFile& ...
- POI生成Web版Word文件
POI生成Web版Word文件 1 通过URL的输入流实现 2 直接把Html文本写入到Word文件 所谓的使用POI生成Web版Word文件是指利用POI将Html代码插入到 ...
- Office Word文件批量生成软件
一.软件用途 如果Word文件模板固定,只是要素信息不同,则可以使用本软件批量生成Word文件. 软件下载地址(2020-12-6更新):https://files.cnblogs.com/files ...
- 根据指定Word模板生成Word文件
最近业务需要批量打印准考证信息 1.根据Table数据进行循环替换,每次替换的时候只替换Word中第一个Table的数据, 2.每次替换之后将Word中第一个Table数据进行复制,将复制Table和 ...
- java生成带html样式的word文件
参考:http://blog.csdn.net/xiexl/article/details/6652230 最近在项目中需要将通过富文本编辑器处理过的文字转换为Word,查了很久,大家通常的解决办法是 ...
- 利用html模板生成Word文件(服务器端不需要安装Word)
利用html模板生成Word文件(服务器端不需要安装Word) 由于管理的原因,不能在服务器上安装Office相关组件,所以只能采用客户端读取Html模板,后台对模板中标记的字段数据替换并返回给客户端 ...
- JSP生成word文件
1.jsp生成word文件,直接改动jsp格式: <%@ page contentType="application/vnd.ms-word;charset=GB2312"% ...
- windows&lunix下node.js实现模板化生成word文件
最近在做了一个小程序!里面有个功能就是根据用户提交的数据,自动生成一份word文档返回给用户.我也是第一次做这功能,大概思路就是先自己弄一份word模板,后台接受小程序发过来的数据,再根据这些数据将相 ...
随机推荐
- 运行sql server profiler所需的权限
********运行Sql Server Profiler所需的权限(performance)*********/ --EG. -- 使用TRACE帐户(Performancetest)跟踪Sql S ...
- ajax异步提交文件
首先 下载jquery和jquery.form.js http://malsup.com/jquery/form/ <script type="text/javascript&qu ...
- 减去border边框
width: 100%; border: 1px solid transparent; box-sizing: border-box;
- configs for postgresql restart and postgresql reload
-- configs requiring postgresql restart select name, setting, context from pg_settings where context ...
- 获取网络IP地址
IPHostEntry iphost = Dns.GetHostEntry(txtDNS.Text);//解析并返回IPHostEntry对象 foreach (IPAddress ip in iph ...
- [转]解析json:与array,list,map,bean,xml相互转化
一.解析json之net.sf.json 下载地址 使用netsfjson需要导入的包 JSONObject JSONArray JavaBean与json字符串互转 List与json字符串互转 M ...
- [转]-Dmaven.multiModuleProjectDirectory system propery is not set. 解决方案 适用于myeclipes 和 eclipes
eclipse中使用maven插件的时候,运行run as maven build的时候报错 -Dmaven.multiModuleProjectDirectory system propery is ...
- [转] java编程规范
原文链接: 资料推荐--Google Java编码规范 之前已经推荐过Google的Java编码规范英文版了: http://google-styleguide.googlecode.com/svn/ ...
- Ruby界面开发--wxRuby库TextCtrl相关问题
界面库官方教程:(1) 总的各种库函数讲解http://wxruby.rubyforge.org/doc/index.html (2)TextCtrl讲解 http://wxruby.rubyforg ...
- c++之路进阶——codevs2333(弹飞绵羊)
2333 弹飞绵羊 2010年省队选拔赛湖南 时间限制: 1 s 空间限制: 128000 KB 题目等级 : 大师 Master 题目描述 Description Lostmonk ...