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. Win32 SDK - 打开文件对话框

    OPENFILENAME ofn; // common dialog box structure TCHAR szFile[MAX_PATH]; // buffer for file name // ...

  2. opensips编译安装时可能遇到的问题

    错误一: ERROR: could not load the script in /usr/local//lib64/opensips/opensipsctl/opensipsdbctl.pgsql ...

  3. 细说WebSocket -- Node.js篇

    在上一篇提高到了 web 通信的各种方式,包括 轮询.长连接 以及各种 HTML5 中提到的手段.本文将详细描述 WebSocket协议 在 web通讯 中的实现. 一.WebSocket 协议 1. ...

  4. char类型到底是有符号还是无符号

    根据c标准,char类型到底是有符号整数类型还是无符号整数类型,这取决于c实现,也就是c编译器的作者的想法:( 那么,如何快速的编写一个检测程序,查看当前编译器如何对char进行定义? #includ ...

  5. CYQ多数据库链接

     枚举名XXXEnum  对应XXXConn的配置数据库链接项 ,不多说,一看就明白!名字空间得要带上数据库名!

  6. mongod安装

    mongod.exe --dbpath "D:\Program Files\MongoDB\log\log.txt" mongod.exe --dbpath "D:\Pr ...

  7. 【Android】15.4 例15-2--Notification基本用法

    分类:C#.Android.VS2015: 创建日期:2016-02-29 一.简介 上一节介绍了通知(Notification)相关的基本内容.这一节先用一个简单示例演示创建和发布本地通知的基本用法 ...

  8. jae的mongo数据库管理工具(原创)

    园里前段时间有人介绍了京东的jae,申请了试用了一下,各种坑,勉强可以测试用用. jae一直没有Mongo数据库的管理工具,没办法,自己写了一个凑合着先用着. 使用方法: 1.修改配置:下载后面的程序 ...

  9. jquery 获取字符串中的数字

    str_num = 'abc123' num = parseInt(str_num.replace(/[^0-9]/ig,"")); alert(num);

  10. excel鼠标拖选慢shift选择快的问题

    今天遇到个惊天大坑,关于excel的,最近,一直在调查这个东西,刚开始真的是毫无头绪,反正现在就是excel的值的copy会偶尔慢,慢的情况也是不明白,就是稀里糊涂的调查. 刚开始连100%再现这个b ...