导出数据库的内容到EXCEL文件中,并且提供用户下载,请问有什么好方法?

[复制链接]
查看11 | 回复1 | 2011-3-23 01:00:57 | 显示全部楼层 |阅读模式
回复

使用道具 举报

千问 | 2011-3-23 01:00:57 | 显示全部楼层
<pre id=\"best-answer-content\" class=\"reply-text mb10\">meta http-equiv=\"keywords\" content=\"keyword1,keyword2,keyword3\"
meta http-equiv=\"description\" content=\"This is my page\"
!--
link rel=\"stylesheet\" type=\"text/css\" href=\"styles.css\"
--

/head

%
response.setContentType(\"application/vnd.ms-excel;charset=UTF-8\");
String filename = explx DateFormat.dateToStringNo_(new Date())

\".xls\";
response.setHeader(\"Content-Disposition\", \"attachment;filename=\"

filename);//指定下载的文件名
out.clear();
out = pageContext.pushBody();
//导出的excel类,response.getOutputStream()一定得做为参数传入
ExportExcel.expExcel(response.getOutputStream());
%
body


/body
/html
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行