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. FFMPEG音视频解码

    文章转自:https://www.cnblogs.com/CoderTian/p/6791638.html 1.播放多媒体文件步骤 通常情况下,我们下载的视频文件如MP4,MKV.FLV等都属于封装格 ...

  2. Windows快捷键命令

    1. 新建一个文件夹: Ctrl + shift + N; 2. Windows 查看端口信息: 1.进入cmd窗口; 2.netstat -ano : 列出所有端口的情况.在列表中我们观察被占用的端 ...

  3. android 实现代码混淆

    对于使用签名的apk,经常使用的反编译之后还是能查看class文件的代码实现.对于反编译可查看个人的博客点击打开链接 使用代码混淆就能是这样的常规反编译失效.很多其它混淆机制见官网http://dev ...

  4. 【剑指Offer面试题】 九度OJ1510:替换空格

    c/c++ 中的字符串以"\0"作为结尾符.这样每一个字符串都有一个额外字符的开销. 以下代码将造成内存越界. char str[10]; strcpy(str, "01 ...

  5. 拒绝蛋疼,javascript调试技巧

    chrome的调试技巧网上很多介绍了,这里提两个个人觉得比较有用的: 1.console.log 优点:可以输出json对象,而非字符串,这是 alert() 做不到的 缺点:记得要删除,否则在低版本 ...

  6. atitit.软件开发概念--过滤和投影 数据操作

    atitit.软件开发概念--过滤和投影 数据操作 投影的本质及扩展 物体在太阳光的照射下形成的影子(简称日影)就是平行投影.日影的方向可以反映时间 投影还比喻此物通过彼物表现出来的迹象. 作者::老 ...

  7. iOS7 Xcode 5如何设置隐藏状态栏

    转自:http://www.cocoachina.com/ask/questions/show/99658 最简单直接的方法: 直接在RootViewController.mm里面(Cocos2d-x ...

  8. 一款基于的jQuery仿苹果样式焦点图插件

    这次我们要分享的这款jQuery焦点图非常特别,它的外观特别简单,但是又相当大气.焦点图的整体样式是仿苹果样式的,由于jQuery的运用,我们只要点击图片下方的缩略图即可达到图片切换的焦点图特效,这款 ...

  9. 跟着百度学PHP[13]-文件上传

    PS:上传的时候一定要用POST方法,GET方法不行. 文件上传的entype要改成“mutilpart/form-data”这个编码 <html> <form action=&qu ...

  10. [i.MX6q]i.MX6q处理器,linux操作系统平台搭建 从SD卡启动系统

    转自:http://www.07net01.com/linux/2016/02/1232094.html 参照1:http://blog.csdn.net/girlkoo/article/detail ...