EL表达式查询出来的数据,下载成excel表格,很实用的
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page contentType="application/vnd.ms-excel; charset=gbk" %>
<%@page import="java.text.SimpleDateFormat"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
SimpleDateFormat sf = new SimpleDateFormat("yyyyMMddkkmmssSSS");
String filename = new String(("文件名字-"+sf.format(new Date())).getBytes("gbk"),"ISO-8859-1");
response.addHeader("Content-Disposition", "filename=" + filename + ".xls");
%>
<%@ page isELIgnored="false"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>XX信息</title>
<link href="<%=basePath%>pages/packageInfo/css/table.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="boderBG">
<table id="hacker" width="98%" border="0" cellspacing="1" cellpadding="0" class="dataTable">
<thead><tr>
<th width="11%" height="23" align="center">XX</th>
<th width="11%" align="center">XX</th>
<th width="10%" align="center">XX</th>
<th width="11%" align="center">XX</th>
<th width="11%" align="center">XX</th>
<th width="11%" align="center">XX</th>
<th width="11%" align="center">XX</th>
<th width="11%" align="center">XX</th>
<th width="11%" align="center">XX</th>
</tr>
</thead>
<c:forEach var="calRecordList" items="${calRecordList}" >
<tr>
<td height="23" >${calRecordList.callnum}</td>
<td >${calRecordList.toCallnum}</td>
<td><fmt:formatDate value="${calRecordList.begintime}" pattern="yyyy年MM月dd HH:mm:ss" /></td>
<td align="center"><fmt:formatDate value="${calRecordList.endtime}" pattern="yyyy年MM月dd HH:mm:ss" /></td>
<td align="center">${calRecordList.calltype}</td>
<td align="center">${calRecordList.talktime}</td>
<td align="center">${calRecordList.billtime}</td>
<td align="center">${calRecordList.fee}</td>
<td align="center">${calRecordList.groupid}</td>
</tr>
</c:forEach>
</table>
</div>
</body>
</html>
EL表达式查询出来的数据,下载成excel表格,很实用的的更多相关文章
- 项目中对获取的数据进行下载成Excel表格
//moment是操作日期的插件 //引入lodash是为了方便操作数据 //xlsx是获取表格的必须插件 import moment from 'moment'; import _ from ...
- java将数据库中查询到的数据导入到Excel表格
1.Maven需要的依赖 <!-- https://mvnrepository.com/artifact/org.apache.poi/poi --> <dependency> ...
- EL表达式获取值栈数据
---------------------siwuxie095 EL 表达式获取值栈数据 1.导入 JSTL 相关包,下载链接: (1)http://tomcat.apache.org/taglibs ...
- sqlserver将数据库的数据导成excel文档方法
sqlserver将数据库的数据导成excel文档方法 最近公司需要下载uniport的数据跟之前的数据进行对比,所以避免不了需要将数据库的数据导出来,把SQLServer表中的数据导出为Excel文 ...
- Asp.Net MVC 实现将Easy-UI展示数据下载为Excel 文件
在一个项目中,需要做一个将Easy-UI界面展示数据下载为Excel文件的功能,经过一段时间努力,完成了一个小Demo.界面如下: 但按下导出Excel后,Excel文件将会下载到本地,在office ...
- Pl/sql 如何将oracle的表数据导出成excel文件?
oracle将表数据导出成excel文件的方法 1)在SQL窗体上,查询需要导出的数据 --查询数据条件-- ; 结果视图 2)在查询结果的空白处,右键选择Copy to Excel 3) 查看导出e ...
- springboot2.0数据制作为excel表格
注意:由于公司需要大量导出数据成excel表格,因此在网上找了方法,亲测有效. 声明:该博客参考于https://blog.csdn.net/long530439142/article/details ...
- Python Json分别存入Mysql、MongoDB数据库,使用Xlwings库转成Excel表格
将电影数据 data.json 数据通过xlwings库转换成excel表格,存入mysql,mongodb数据库中.python基础语法.xlwings库.mysql库.pymongo库.mongo ...
- Java POI读取Excel数据,将数据写入到Excel表格
1.准备 首先需要导入poi相应的jar包,包括: 下载地址:http://pan.baidu.com/s/1bpoxdz5 所需要的包的所在位置包括: 2.读取Excel数据代码 package S ...
随机推荐
- Android入门(二):Android的系统架构
android的系统架构和其操作系统一样,采用了分层的架构.从架构图看,android分为四个层,从高层到低层分别是应用程序层.应用程序框架层.系统运行库层和linux核心层. 从技术方面看,An ...
- 转:AngularJS的Filter用法详解
Filter简介 Filter是用来格式化数据用的. Filter的基本原型( '|' 类似于Linux中的管道模式): {{ expression | filter }} Filter可以被链式使用 ...
- 【BZOJ】3835: [Poi2014]Supercomputer
题意 \(n(1 \le 1000000)\)个点的有根树,\(1\)号点为根,\(q(1 \le 1000000)\)次询问,每次给一个\(k\),每一次可以选择\(k\)个未访问的点,且父亲是访问 ...
- 李洪强iOS经典面试题140-UI
李洪强iOS经典面试题140-UI UI viewcontroller的一些方法的说明viewDidLoad,viewWillDisappear, viewWillAppear方法的 顺序和作用? ...
- [LintCode] Majority Number 求众数
Given an array of integers, the majority number is the number that occurs more than half of the size ...
- JDBC编程
简单地说,JDBC 可做三件事:与数据库建立连接.发送 SQL 语句并处理结果.下列代码段给出了以上三步的基本示例: Connection con = DriverManager.getConnect ...
- 手动编译安装LNMP
yum -y install gcc gcc-c++ autoconf nss_ldap libjpeg libjpeg-devel libpng libpng-devel freetype free ...
- springmvc HandlerInterceptoer WebRequestInterceptor MethodInterceptor使用
HandlerInterceptoer拦截的是请求地址,所以针对请求地址做一些验证.预处理等操作比较合适.
- Asp.Net Mvc Areas 的用法与好处
前言 在项目中为什么要使用Areas 进行分离 大家都知道,一般的Web应用都有前台(面向用户)和后台(面向管理员)两部分,我们希望以/localhost/Admin 开始的Url 是用户的后台管理地 ...
- iOS 因为reason: 'Pushing the same view controller instance more than once is not supported而奔溃(下)
这个问题是什么意思呢,之前遇到过几次,但程序再次打开时没有问题,也就没有重视,今天又遇到了,无法忍受啊. 控制台报的错误是:"不支持多次推入相同的视图控制器实例". 什么原因造成的 ...