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. IntelliJ Idea各种技巧设置笔记和错误解决

    版本控制 GitHub GitHub提示找不到路径: 解决方法:去官方下载gitHub,然后在以下路径找到Git.exe并设置 C:\Users\你的用户\AppData\Local\GitHub\P ...

  2. python如何获取公众号下面粉丝的openid

    如何获取公众号下面粉丝的openid呢,首先要获取一个access_token,这个token可不是令牌(Token),如何获取这个access_token呢?有两种方法,方法如下: # -*- co ...

  3. LIntcode---将二叉搜索树转成较大的树

    Given a Binary Search Tree (BST), convert it to a Greater Tree such that every key of the original B ...

  4. 如何查看Linux操作系统的位数

    如何查看Linux操作系统的位数 1.编程实现: 在程序中返回sizeof(int)的值,返回的结果是操作系统的字节数.若返回4则是32位操作系统,返回8即是64位. 2.2.getconf命令: g ...

  5. ui-router(三)controller与template

    这篇就是在以前的基础上,把客户端angular.js 负责的部分整体串起来演示一下. 我们按照angular执行顺序来做前提准备: (1)Client 根目录下 index.html 首先加载angu ...

  6. id ,NSObject, id<NSObject>区别

    转自:http://blog.csdn.net/happytengfei/article/details/11473931 我们经常会混淆以下三种申明(我是没有留意过):    1. id foo1; ...

  7. Android Camera API/Camera2 API 相机预览及滤镜、贴纸等处理

    Android Lollipop 添加了Camera2 API,并将原来的Camera API标记为废弃了.相对原来的Camera API来说.Camera2是又一次定义的相机 API,也重构了相机 ...

  8. Struts2初学 Struts.xml详解二

    A.使用继承实现设置全局视图    package节点中还可以设置全局的视图,如:     <global-results>         <result name="e ...

  9. 632. Binary Tree Maximum Node【Naive】

    Find the maximum node in a binary tree, return the node. Example Given a binary tree: 1 / \ -5 2 / \ ...

  10. Selenium - Webdriver API /ActionChains API

    一.控制浏览器 1.1 控制浏览器窗口大小 # 获取当前浏览器的大小  driver.get_window_size() # 通过像素设置浏览器的大小  driver.set_window_size( ...