jsp导出
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="java.net.URLEncoder"%>
<%@ include file="../include/commons-include.jsp" %>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<%
String filename = "账户合计.xls";
filename =URLEncoder.encode(filename,"UTF-8");
response.setHeader("Pragma ", "public");
response.setHeader("Cache-Control ", "must-revalidate, post-check=0, pre-check=0 ");
response.addHeader("Cache-Control ", "public ");
response.addHeader("Content-Disposition", "attachment; filename="+filename);
response.setContentType("application/vnd.ms-excel.numberformat:@;charset=UTF-8");
%>
<html>
<head>
<style>
table {
border: thin solid #333;
border-collapse: collapse;
border-spacing: 0px;
}
th {
background-color: #ccc;
border: thin solid #333;
}
td {
border: thin solid #000;
}
</style>
</head>
<body>
<table cellpadding="1" cellspacing="1" align="center" class="global_tableresult" style="width: 100%;vnd.ms-excel.numberformat:@">
<tr>
<th nowrap="true">交易时间</th>
<th nowrap="true">业务编码</th>
<th nowrap="true">系统来源</th>
<th nowrap="true">资金标识</th>
<th nowrap="true">交易金额</th>
<th nowrap="true">账号编码数量</th>
</tr>
<c:forEach items="${lst }" var="ard">
<tr align="center">
<td><fmt:formatDate value="${ard.transTime }" pattern="yyyy-MM-dd"/></td>
<td><dict:write dictTypeCode="account.BussinessCode" dictKey="${ard.bussinessCode }" /></td>
<td>${ard.systemCode }</td>
<td><dict:write dictTypeCode="account.FundSymbol" dictKey="${ard.symbol }" /></td>
<td><fmt:formatNumber value="${ard.transAmount }" pattern="#.##"/></td>
<td>${ard.code }</td>
</tr>
</c:forEach>
</table>
</body>
</html>
jsp导出的更多相关文章
- JSP导出Excel后身份证后三位为0
JSP导出Excel身份证号码超出Excel最大限制,用科学计数法表示,但后三位为0,修改方式: <style type="text/css">.txt { ...
- jsp导出Excel功能的实现
借助POI的excel接口,可以方便得实现excel导出功能: 首先需要引入poi对应的jar包 1.前端jsp页面需要一个a链接. web页面文件MIM类型的下载,只需要一个a元素,该a可以链到该文 ...
- jsp导出excel
很多时候,我们都知道在java项目里面采用poi来导出excel很方便,但是如果你的项目采用的是jsp你可以用更简单的方法来导出.首先你要在顶部引入:<jsp:directive.page im ...
- jsp导出简单的excel
在jsp中加入以下代码即可 <% String fileName = "导出excel.xls"; fileName = new String(fileName.getByt ...
- jsp导出到Excel
jsp模板文件 <%@ page isELIgnored="false" contentType="application/x-msdownload; charse ...
- JSP 导出Excel表格
ES6语法 传入一个table的id,然后在导出excel按钮上加入一个<a href="#" id="buttonId">导出Excel</ ...
- java、jsp导出excel功能备份
问题踩坑: ajax请求不能下载文件 必须这样: <a href="/media">点击下载Excel</a> 或者 location.href = '/m ...
- JSP导出Excel文件
和普通的查询数据差别是没有分页,response设置一下就是到处功能. window.location.href="${_base}/promoteConsume/exportExcel?& ...
- html/jsp导出pdf格式的几种方法(jsPDF,iText,wkhtmltopdf)
在许多生成报表的时候需要我们后台作出动态的数据,并渲染到前端生成pdf格式,Excel格式的各种报表,但是浏览器自带的生成pdf功能,windows系统的ctrl+p键就能完全搞定这一需求,但对客户来 ...
随机推荐
- ini_set() php.ini设置的功能
ini_set()具有更改php.ini设置的功能.此函数接收两个参数:需要调整的配置变量名,以及变量的新值. [c-sharp] view plaincopyprint? <?php ini_ ...
- Angular 5 快速入门与提高
一.概述 尽管被称为Angular5,实际上它只是这个诞生于2012年的前端框架的的第四个版本: 看起来差不多半年就发布一个新版本,不过实际上从重写的版本2开始,开发 接口与核心思想就稳定下来了,并基 ...
- php 获取当前域名
#测试网址: http://localhost/blog/testurl.php?id=5 //获取域名或主机地址 echo $_SERVER['HTTP_HOST']."<br> ...
- xilinx 赛灵思fpga verilog hdl 教程
http://www.eefocus.com/article/08-03/37231s.html http://wenku.baidu.com/link?url=5mdkMmm4BGGi7gRdgSk ...
- 嵌入式开发之davinci--- 8148/8168/8127 中swms、Mosaic’s、display 显示pal 模式
(1) (2) (3) (4) -------------------------author:pkf ------------------------------time:2-3 --------- ...
- caffe使用自己的数据做分类
这里只举一个例子: Alexnet网络训练自己数据的过程 用AlexNet跑自己的数据 参考1:http://blog.csdn.net/gybheroin/article/details/54095 ...
- 使用jenkins进行Android的持续集成
关于持续集成的定义和意义可以参考它的 百度百科 主要意义有以下几点: 减少风险 减少重复过程 任何时间.任何地点生成可部署的软件 增强项目的可见性 建立团队对开发产品的信心 持续集成的实施 持续集成的 ...
- ubuntu虚拟化平台libvrit-bin
http://download.cirros-cloud.net/0.3.5/ 下载 cirros-0.3.5-x86_64-disk.img 因为 KVM(准确说是 Libvirt)默认不接受远程管 ...
- csu1326(The contest)
题目链接:传送门 题目思路:并查集加分组背包 #include <iostream> #include <cstdio> #include <cstdlib> #i ...
- 2588: Spoj 10628. Count on a tree
2588: Spoj 10628. Count on a tree Time Limit: 12 Sec Memory Limit: 128 MBSubmit: 5766 Solved: 1374 ...