jsp模板文件

<%@ page isELIgnored="false" contentType="application/x-msdownload; charset=GBK"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<html xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns="http://www.w3.org/TR/REC-html40">
<%@ taglib uri="/WEB-INF/sino-tags.tld" prefix="sino"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/struts-html-el.tld" prefix="html-el"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/struts-logic-el.tld" prefix="logic-el"%> <%
int i = 0;
String tableTitle = "第三方巡查数据导出";
String filename = new String((tableTitle).getBytes("GBK"), "ISO-8859-1") + ".xls";
response.setHeader("Content-Disposition", "attachment;filename=" + filename);
%> <head>
<meta http-equiv="Content-Type"
content="application/x-msexcel;charset=gb2312">
<meta name=ProgId content=Excel.Sheet>
<meta name=Generator content="Microsoft Excel 11">
<link rel=File-List href="Book1.files/filelist.xml">
<link rel=Edit-Time-Data href="Book1.files/editdata.mso">
<link rel=OLE-Object-Data href="Book1.files/oledata.mso"> <style>
<!--
table {
mso-displayed-decimal-separator: "\.";
mso-displayed-thousand-separator: "\,";
} @page {
margin: 1.0in .75in 1.0in .75in;
mso-header-margin: .5in;
mso-footer-margin: .5in;
} tr {
mso-height-source: auto;
mso-ruby-visibility: none;
} col {
mso-width-source: auto;
mso-ruby-visibility: none;
} br {
mso-data-placement: same-cell;
} .xl29 {
mso-style-parent: style0;
font-size: 17.0pt;
font-weight: 700;
text-align: center;
mso-pattern: auto none;
background: #DDDDDD;
} -->
</style>
<!--[if gte mso 9]><xml>
<x:ExcelWorkbook>
<x:ExcelWorksheets>
<x:ExcelWorksheet>
<x:Name>Sheet1</x:Name>
<x:WorksheetOptions>
<x:DefaultRowHeight>285</x:DefaultRowHeight>
<x:Selected/>
<x:Panes>
<x:Pane>
<x:Number>3</x:Number>
<x:ActiveRow>10</x:ActiveRow>
<x:ActiveCol>3</x:ActiveCol>
</x:Pane>
</x:Panes>
<x:ProtectContents>False</x:ProtectContents>
<x:ProtectObjects>False</x:ProtectObjects>
<x:ProtectScenarios>False</x:ProtectScenarios>
</x:WorksheetOptions>
</x:ExcelWorksheet>
<x:ExcelWorksheet>
<x:Name>Sheet2</x:Name>
<x:WorksheetOptions>
<x:DefaultRowHeight>285</x:DefaultRowHeight>
<x:ProtectContents>False</x:ProtectContents>
<x:ProtectObjects>False</x:ProtectObjects>
<x:ProtectScenarios>False</x:ProtectScenarios>
</x:WorksheetOptions>
</x:ExcelWorksheet>
<x:ExcelWorksheet>
<x:Name>Sheet3</x:Name>
<x:WorksheetOptions>
<x:DefaultRowHeight>285</x:DefaultRowHeight>
<x:ProtectContents>False</x:ProtectContents>
<x:ProtectObjects>False</x:ProtectObjects>
<x:ProtectScenarios>False</x:ProtectScenarios>
</x:WorksheetOptions>
</x:ExcelWorksheet>
</x:ExcelWorksheets>
<x:WindowHeight>8445</x:WindowHeight>
<x:WindowWidth>11715</x:WindowWidth>
<x:WindowTopX>240</x:WindowTopX>
<x:WindowTopY>15</x:WindowTopY>
<x:ProtectStructure>False</x:ProtectStructure>
<x:ProtectWindows>False</x:ProtectWindows>
</x:ExcelWorkbook>
</xml><![endif]-->
</head>
<body link=blue vlink=purple> <table x:str border=0 cellpadding=0 cellspacing=0 width=551
style='table-layout: fixed; width: 680pt; border: 0px solid #000000;'>
<tr height=19 style='height: 14.25pt;border: 0px;'>
<td align="center" colspan='8' >
<b>第三方巡查数据导出</b>
</td>
</tr>
<tr height=19 style='height: 14.25pt;border: 0px;'>
<td align="left" colspan='8' > </td>
</tr>
<tr height=19 style='height: 14.25pt;border: 0px;'>
<td align="left" colspan='5'> </td>
<td align="left" colspan='3'> </td>
</tr>
</table>
<table x:str border=1 cellpadding=0 cellspacing=0 width=551
style='table-layout: fixed; width: 680pt; border: 1px solid #000000;'>
<col width=30
style='mso-width-source: userset; mso-width-alt: 2784; width: 30pt'>
<col width=30
style='mso-width-source: userset; mso-width-alt: 5120; width: 30pt'>
<col width=30
style='mso-width-source: userset; mso-width-alt: 5120; width: 30pt'>
<col width=150
style='mso-width-source: userset; mso-width-alt: 4000; width: 150pt'>
<col width=30
style='mso-width-source: userset; mso-width-alt: 5728; width: 60pt'>
<col width=60
style='mso-width-source: userset; mso-width-alt: 2784; width: 60pt'>
<col width=300
style='mso-width-source: userset; mso-width-alt: 5120; width: 300pt'>
<tr height=19 style='height: 14.25pt;'>
<td width=30 style='text-align:center'>
序号
</td>
<td width=30 style='text-align:center'>
线路
</td>
<td width=30 style='text-align:center'>
单位工程
</td>
<td width=150 style='text-align:center'>
标题
</td>
<td width=60 style='text-align:center'>
巡查单位
</td>
<td width=60 style='text-align:center'>
巡查时间
</td>
<td width=60 style='text-align:center'>
巡查结果
</td>
<td width=60 style='text-align:center'>
是否预警
</td>
<td width=300 style='text-align:center'>
预警等级
</td>
</tr>
<s:if test="#request.list.size!=0">
<s:iterator value="#request.list" id="obj" status="index" >
<tr height=19 style='height: 14.25pt;'>
<td height="22" align="center" onClick="">
<s:property value='#index.index+1'/>
</td>
<td height="22" align="left">
<s:property value='lineName' />
</td>
<td height="22" align="center">
<s:property value='alias' />
</td>
<td height="22" align="center">
<s:property value='title' />
</td>
<td height="22" align="center">
<s:property value='companyName' />
</td>
<td height="22" align="center">
<s:property value='patrolTimeStr' />
</td>
<td height="22" align="center">
<s:property value='patrolResult' />
</td>
<td height="22" align="center">
<s:property value='isAlarm' />
</td>
<td height="22" align="left" >
<s:property value='warningLevel' />
</td>
</tr>
</s:iterator>
</s:if>
<s:if test="#request.list.size==0">
<tr>
<td colspan="9">未找到任何数据</td>
</tr>
</s:if> </table> </body> </html>

jsp导出到Excel的更多相关文章

  1. JSP导出Excel后身份证后三位为0

    JSP导出Excel身份证号码超出Excel最大限制,用科学计数法表示,但后三位为0,修改方式: <style type="text/css">.txt    {    ...

  2. jsp 页面内容导出到Excel中

    日常使用网络资源时经常需要把网页中的内容下载到本地,并且导出到Excel中,现在介绍一种非常简单的方式实现网络资源的下载.只需要讲jsp的最上面加上一句话 <% response.reset() ...

  3. atitit.导出excel的设计----查询结果 导出为excel的实现java .net php 总结

    atitit.导出excel的设计----查询结果 导出为excel的实现java .net php 总结 1. 基本的流程 查询获得list 读取jsp的table获得标题and 字段的map to ...

  4. JAVA实现数据库数据导入/导出到Excel(POI)

    准备工作: 1.导入POI包:POI下载地址http://mirrors.tuna.tsinghua.edu.cn/apache/poi/release/src/(重要) 如下 2.导入Java界面美 ...

  5. MySQL要导出成excel的方法

    MySQL 要导出成 excel 文件很简单,执行类似这样的命令:   select * from 某个表 into outfile  'd:/文件名.xls';   上述命令你在服务器上执行,就导在 ...

  6. ssm框架之将数据库的数据导入导出为excel文件

    在这里首先我要将自己遇到的各种问题,以及需求记录下来,做一个备忘,便于以后查看: 需求:主要实现两个功能,将oracle数据库里的数据导出为excel,同时需要将excel表格的数据导入到数据库 环境 ...

  7. 网站开发进阶(二十五)js如何将html表格导出为excel文件

    js如何将html表格导出为excel文件        赠人玫瑰,手留余香.若您感觉此篇博文对您有用,请花费2秒时间点个赞,您的鼓励是我不断前进的动力,共勉! jsp页面数据导出成excel的方法很 ...

  8. 使用apache的poi来实现数据导出到excel的功能——方式二

    此次,介绍利用poi与layui table结合导出excel.这次不需要从数据库中查询出来的数据进行每一行的拼接那么麻烦,我们这次将标题定义一个id值,对应从数据库中查找出来的字段名即可. 1.po ...

  9. DataTable导出到Excel

    简单的导出到Excel中: 代码如下: using System; using System.Collections.Generic; using System.Data; using System. ...

随机推荐

  1. python ichat使用学习记录

    1.OSError: [WinError -2147221003] 找不到应用程序: 'D:\\python\\ichat\\qrcode.jpg' 原因是该库中没有windows系统如何打开二维码图 ...

  2. Java入门 第一季第二章 变量和常量

    这是我学习慕课网Java课程的笔记.原视频链接为:http://www.imooc.com/learn/85 2-1 Java中的keyword PS:Javakeyword区分大写和小写 2-2 认 ...

  3. java反射详解及说明

    首先写一个Person类: package lltse.base.reflectdemo; public class Person { private String name ="张三&qu ...

  4. scikit-learn:4.2.3. Text feature extraction

    http://scikit-learn.org/stable/modules/feature_extraction.html 4.2节内容太多,因此将文本特征提取单独作为一块. 1.the bag o ...

  5. Lintcode---翻转二叉树

    翻转一棵二叉树 您在真实的面试中是否遇到过这个题? Yes 样例 1 1 / \ / \ 2 3 => 3 2 / \ 4 4 思路:依旧采用递归的思路,判断特殊条件后,先交换根节点的左右孩子, ...

  6. mybatis 映射器

    1 映射器 Mapper 是由java接口和 XML 文件共同组成.它的作用如下 1)定义参数类型 2)描述缓存 3)描述 SQL 语句 4)定义查询结果和POJO的映射关系 2 SqlSession ...

  7. Spring Cloud(一):概述以及核心成员介绍

    什么是Spring Cloud? Spring Cloud是一个基于Spring Boot实现的云应用开发工具,它为基于JVM的云应用开发中的配置管理.服务发现.断路器.智能路由.微代理.控制总线.全 ...

  8. maven ArtifactTransferException:failure

    手动下载对应jar放在本地仓库 -> Update Dependencies(Maven4Myeclipse:eclipse上maven插件)

  9. 禁止用户登陆的 /bin/false和/sbin/nologin的区别

    1 区别 /bin/false是最严格的禁止login选项,一切服务都不能用. /sbin/nologin只是不允许login系统  小技巧: 查看 /etc/passwd文件,能看到各用户使用的sh ...

  10. [svc]salt安装lamp

    在批量安装软件前,先找台测试机yum装一遍,看是否报错等,是否依赖包全等 . 本次我们在dev环境下搞. 先看一下已搞成功的目录结构 定义dev环境的第二个好处 搞清楚逻辑结构和调用关系很重要,不然之 ...