`
朱嘉华
  • 浏览: 236253 次
  • 性别: Icon_minigender_2
  • 来自: 北京
社区版块
存档分类
最新评论

|导成Excel|

    博客分类:
  • js
阅读更多
<%@ page language="java" pageEncoding="GBK"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles"%>
<%@ page import="java.util.*" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html:html lang="true">
<head>
<html:base />

<title>EmpParticular.jsp</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">

<SCRIPT LANGUAGE="JavaScript">
<!--

function outDoc(){

var table=document.getElementById("custome");
row=table.rows.length;
column=table.rows(1).cells.length;

var excelapp=new ActiveXObject("Excel.Application");

excelapp.visible=true;
objBook=excelapp.Workbooks.Add();
var objSheet=objBook.ActiveSheet;
for(i=0;i<row;i++){
   for(j=0;j<column;j++){
   
   objSheet.Cells(i+1,j+1).value=table.rows(i).cells(j).innerHTML.replace("&nbsp;","");    
      
      
   }
    }

objBook.SaveAS("customerList.xls");
excelapp.UserControl=true;


}
//-->
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
function outDoc2(){

var table=document.getElementById("familyMember");
row=table.rows.length;
column=table.rows(1).cells.length;

var excelapp=new ActiveXObject("Excel.Application");

excelapp.visible=true;
objBook=excelapp.Workbooks.Add();
var objSheet=objBook.ActiveSheet;
for(i=0;i<row;i++){
   for(j=0;j<column;j++){
   
   objSheet.Cells(i+1,j+1).value=table.rows(i).cells(j).innerHTML.replace("&nbsp;","");    
      
  
   }
    }

objBook.SaveAS("customerList.xls");
excelapp.UserControl=true;


}
//-->
</SCRIPT>

     <style type="text/css">
/* CSS Document */

   body {
   font: normal 11px autoTrebuchet MS, Verdana, Arial, Helvetica, sans-serif;
   color: #000000;
   background: #E6EAE9;
   }

   a {
   color: #c75f3e;
   }

   #mytable {
   width: 700px;
   padding: 0;
   margin: 0;
   }

   caption {
   padding: 0 0 5px 0;
   width: 700px;
   font: italic 11px Trebuchet MS, Verdana, Arial, Helvetica, sans-serif;
   text-align: right;
   }

   th {
   font: bold 11px Trebuchet MS, Verdana, Arial, Helvetica, sans-serif;
   color: #000000;
   border-right: 1px solid #C2D9FE;
   border-bottom: 1px solid #C2D9FE;
   border-top: 1px solid #C2D9FE;
   letter-spacing: 2px;
   text-transform: uppercase;
   text-align: left;
   padding: 6px 6px 6px 12px;
   background: #CAE8EA url(images/bg_header.jpg) no-repeat;
   }
   td {
   border-right: 1px solid #C2D9FE;
   border-bottom: 1px solid #C2D9FE;
   background: #fff;
   font-size:11px;
   padding: 6px 6px 6px 12px;
   color: #000000;
   }
   td.alt {
   background: #F5FAFA;
   color: #797268;
   }
   th.spec {
   border-left: 1px solid #C2D9FE;
   border-top: 0;
   background: #fff url(images/bullet1.gif) no-repeat;
   font: bold 10px Trebuchet MS, Verdana, Arial, Helvetica, sans-serif;
   }
   th.specalt {
   border-left: 1px solid #C2D9FE;
   border-top: 0;
   background: #f5fafa url(images/bullet2.gif) no-repeat;
   font: bold 10px Trebuchet MS, Verdana, Arial, Helvetica, sans-serif;
   color: #797268;
   }
   /*---------for IE 5.x bug*/
   .btn2 {padding: 2 4 0 4;font-size:12px;height:23;background-color:#ece9d8;border-width:1;}

   /*新加的!!!*/
   input.in{
   font:bold;
   border: 3px double #ece9d8;

   background-color: #f5fafa;
   font-size: 12px;
   padding-top: 1px;
   cursor: hand;
   FILTER: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#ffffff, EndColorStr=#C2D9FE);
   }
   input{
   font:bold;
   border: 2px double #ece9d8;
   background-color: #f5fafa;
   font-size: 12px;
   padding-top: 1px;
   cursor: hand;
   FILTER: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#ffffff, EndColorStr=#C2D9FE);
   }
   input.but{
   font:bold;
   color:#797268;
   border: 3px double #ece9d8;
   height: 22px;
   width: 85px;
   background-color: #f5fafa;
   font-size: 12px;
   padding-top: 1px;
   cursor: hand;
   FILTER: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#ffffff, EndColorStr=#C2D9FE);
   }
   .sel { font-size: 12px; width: 100px; position: relative; left: -2px; top: -2px;}
   .box { border:1 solid #BBBBBB; height: 19px; width: 99px; }
   .box2 { border:1 solid #FFFFFF; overflow: hidden; width: 97px; height: 17px; }
   .biaoti{
   FONT-SIZE: 12pt; FILTER: glow(color=000000,strength=2) dropshadow(color=#3333FF,offx=1, offy=1, positive=2); MARGIN: 0px; COLOR: #ffffff; HEIGHT: 20px; TEXT-DECORATION: none
   }
   input.btn2 {padding: 2 4 0 4;font-size:12px;height:23;background-color:#ece9d8;border-width:1;color:#797268;}
.style10 {
font-family: "仿宋_GB2312";
color: #000000;
font-size: 20px
}
.style5 {font-size: 36px}
</style>

</head>

<body>
<html:form action="user.do" method="post">
   <html:hidden property="action" value="out" />


   <table width="780" border="1" align="center" id="custome" >
    <tr align="center">
     <td height="30" colspan="4">

      <strong> <img src="/Curative/jsp/hr/images/bottom.jpg" width="780" height="30" align="absbottom"> </strong>

     </td>
    </tr>
  
    <logic:notEmpty name="LIST">
     <logic:iterate id="list" name="LIST" type="net.dbnet.curative.model.PersonBase">

      <tr align="center">
       <td height="30" colspan="4">
        <span class="style4">员工的 详细资料 </span>
       </td>
      </tr>
      <tr align="center" valign="middle">
       <td width="220" height="30">
        <span class="style4"> <strong> 科室编号 : </strong> </span>
       </td>
       <td width="180" height="30">
        <bean:write name="list" property="sectionNo" />
       </td>
       <td width="210" height="30" align="center">
        <span class="style4"> <STRONG> 最高学历: </STRONG> </span>
       </td>
       <td width="172" height="30">
        <bean:write name="list" property="highSchoolin" />
       </td>
      </tr>

      <tr align="center" valign="personName">
       <td height="30">
        <span class="style4"> <strong> 登陆用户名 : </strong> </span>
       </td>
       <td height="30">

        <bean:write name="list" property="loginName" />
       </td>
       <td height="30" align="center">
        <span class="style10 style11"> <SPAN class="style4"> <STRONG> 登陆密码 : </STRONG> </SPAN> </span>
       </td>
       <td height="30">
        <bean:write name="list" property="loginPassword" />
       </td>
      </tr>


      <tr align="center" valign="personName">
       <td height="30">
        <span class="style4"> <strong> 姓 名 : </strong> </span>
       </td>
       <td height="30">
        <bean:write name="list" property="personName" />
       </td>
       <td height="30" align="center">
        <span class="style10 style11"> <SPAN class="style4"> <STRONG> 学位 : </STRONG> </SPAN> </span>
       </td>
       <td height="30">
        <bean:write name="list" property="degree" />
       </td>
      </tr>
      <tr align="center" valign="middle">
       <td height="30">
        <span class="style4"> <strong> 曾用名 : </strong> </span>
       </td>
       <td height="30">
        <bean:write name="list" property="anotherNo" />
       </td>
       <td height="30" align="center">
        <span class="style10 style11"> <SPAN class="style4"> <STRONG> 获学位时间: </STRONG> </SPAN> </span>
       </td>
       <td height="30">
        <bean:write name="list" property="degreeDate" />
       </td>
      </tr>
      <tr align="center" valign="middle">
       <td height="30">
        <span class="style4"><strong> 拼音码: </strong> </span>
       </td>
       <td height="30">
        <bean:write name="list" property="spellNo" />

       </td>
       <td height="30" align="center">
        <span class="style4"> <strong> 毕业院校 : </strong> </span>
       </td>
       <td height="30">
        <bean:write name="list" property="finishSchool" />

       </td>
      </tr>
      <tr align="center" valign="middle">
       <td height="30">
        <span class="style4"> <strong> 婚否 : </strong> </span>
       </td>
       <td height="30">
        <bean:write name="list" property="marry" />

       </td>
       <td height="30" align="center">
        <SPAN class="style4"> <STRONG> 毕业时间 :   </STRONG> </SPAN>

       </td>
       <td height="30">
        <bean:write name="list" property="finishDate" />

       </td>
      </tr>
      <tr align="center" valign="middle">
       <td height="30">
        <span class="style4"> <STRONG> 性别 : </STRONG> </span>
       </td>
       <td height="30">
        <bean:write name="list" property="personSex" />

       </td>
       <td height="30" align="center">
        <SPAN class="style4"> <STRONG> 授予单位 : </STRONG> </SPAN>
       </td>
       <td height="30">
        <bean:write name="list" property="schoolName" />

       </td>
      </tr>
      <tr align="center" valign="middle">
       <td height="30">
        <span class="style10 style11"> <SPAN class="style4"> <STRONG> 民族 : </STRONG> </SPAN> </span>
       </td>
       <td height="30">
        <bean:write name="list" property="nation" />


       </td>
       <td height="30" align="center">
        <span class="style4"><STRONG> 专业技术职称 : </STRONG> </span>
       </td>
       <td height="30">
        <bean:write name="list" property="titleNo" />

       </td>
      </tr>
      <tr align="center" valign="middle">
       <td height="30">
         <SPAN class="style4"> <STRONG> 出生地 : </STRONG> </SPAN> 
       </td>
       <td height="30">
        <bean:write name="list" property="birthPlace" />

       </td>
       <td height="30" align="center">
        <SPAN class="style4"><STRONG> 职务工资 : </STRONG> </SPAN>
       </td>
       <td height="30">
        <bean:write name="list" property="postWage" />

       </td>
      </tr>
      <tr align="center" valign="middle">
       <td height="30">
        <SPAN class="style4"> <STRONG> 现家庭住址 : </STRONG> </SPAN>
       </td>
       <td height="30">
        <bean:write name="list" property="familyAddress" />

       </td>
       <td height="30" align="center">
         <SPAN class="style4"> <STRONG> 现任行政职务 : </STRONG> </SPAN> 
       </td>
       <td height="30">
        <bean:write name="list" property="postNo" />

       </td>
      </tr>
      <tr align="center" valign="middle">
       <td height="30">
         <SPAN class="style4"> <STRONG> 出生日期 : </STRONG> </SPAN> 
       </td>
       <td height="30">
        <bean:write name="list" property="birthDate" />

       </td>
       <td height="30" align="center">
         <SPAN class="style4"> <STRONG> 从事本专业时间: </STRONG> </SPAN> 
       </td>
       <td height="30">
        <bean:write name="list" property="specialityDate" />

       </td>
      </tr>
      <tr align="center" valign="middle">
       <td height="30">
        <P align="center">
        <SPAN class="style4"> <STRONG> 身份证号 : </STRONG> </SPAN>
        </P>
       </td>
       <td height="30">
        <bean:write name="list" property="capacityNo" />

       </td>
       <td height="30" align="center">
        <span class="style4"> <STRONG> 聘任现职时间 : </STRONG> </span>
       </td>
       <td height="30">
        <bean:write name="list" property="postDate" />

       </td>
      </tr>
      <tr align="center" valign="middle">
       <td height="30">
         <span class="style4"> <strong> 参加何种党派 : </strong> </span> 
       </td>
       <td height="30">
        <bean:write name="list" property="inParty" />

       </td>
       <td height="30" align="center">
        <span class="style4"> <strong>参加工作时间 :   </strong> </span>
       </td>
       <td height="30">
        <bean:write name="list" property="inWorkDate" />

       </td>
      </tr>
      <tr align="center" valign="middle">
       <td height="30">
        <span class="style4"> <strong>参加党派时间 :   </strong> </span>
       </td>
       <td height="30">
        <bean:write name="list" property="portyDate" />

       </td>
       <td height="30" align="center">
        <span class="style4"> <strong> 来校工作时间 : </strong> </span>
       </td>
       <td height="30">
        <span class="style4"> <strong><bean:write name="list" property="inZsuDate" /></strong> </span>

       </td>
      </tr>
      <tr align="center" valign="middle">
       <td height="30">
        <span class="style4"> <strong>   健康情况 : </strong> </span>
       </td>
       <td height="30">
        <span class="style4"> <strong><bean:write name="list" property="health" /></strong> </span>

       </td>
       <td height="30" align="center">
        <span class="style4"> <strong>备注 :</strong> </span>
       </td>
       <td height="30">

        <span class="style4"> <strong><bean:write name="list" property="remarks" /></strong> </span>
       </td>
      </tr>
      <tr align="center" valign="middle">
       <td height="30" colspan="2">
        <input type="submit" value="打印"/><%--onClick="outDoc()

       --%></td>
       <td height="30">
                                          <a href="../../../user.do?action=EmpParticular&personNo1=<bean:write name="list" property="personNo" />"> 修改</a>
       </td>
       <td height="30">
      
       <a href="../../../user.do?action=DeleteEmp&personNo1=<bean:write name="list" property="personNo" />">删除</a>

       </td>
      </tr>
      <tr align="center">

       <td height="30" colspan="4">

        <strong> <img src="/Curative/jsp/hr/images/kecheng_bg.jpg" width="780" height="30" align="absbottom"> </strong>

       </td>
      </tr>
     </logic:iterate>
    </logic:notEmpty>
    <!--<tr align="center">

      <td height="30" colspan="4">

       <strong> <img src="./jsp/hr/images/bottom_0.jpg" width="780" height="30" align="absbottom"> </strong>

      </td>
     </tr>-->
   </table>
  
  
</html:form>

</body>
</html:html>
 

 

分享到:
评论

相关推荐

    将数据导成excel

    在IT行业中,将数据导出为Excel文件是一种常见的需求,特别是在数据分析、报表生成以及数据交换等场景中。这里,我们关注的是如何利用Struts2框架将数据转化为Excel格式。Struts2是一个流行的Java web开发框架,它...

    把页面的table表格导成excel

    注意,是把页面上的table表格导成excel,此方式适用于很复杂的表格导出

    导成Excel代码类

    在“导成Excel代码类”的场景下,我们需要创建一个自定义的类,这个类可能会包含一系列方法,如`ExportToExcel()`,用于将特定的数据结构转换为Excel文件。 在使用Aspose进行Excel导出时,以下是一些关键步骤和知识...

    java将数据导成excel

    Java从数据库获取到数据然后导出成excel文件的方法类...

    excel数据导成sql表数据工具

    可以将excel中数据,需要的列导出成SQL插入语句。已导成jar包,有可视化操作届面,内附详细说明

    javaScript把网页内容导成Excel-高级方法

    我们可以遍历表格中的每一行和每一列,将单元格的数据拼接成CSV字符串,然后通过`window.open()`函数创建一个新的“下载”窗口,将CSV内容写入到这个窗口的URL,从而触发浏览器的下载行为。 以下是一个基本的...

    php 将数据库表导成EXCEL文件

    这样,当你运行这段代码时,浏览器会下载一个名为“database_table.xlsx”的Excel文件,其中包含了从`my_table`表导出的数据。 注意,由于`PHPExcel`库已被弃用,你可以考虑使用`phpspreadsheet`库作为替代,它提供...

    动态生成DataSet填充数据并导成Excel格式

    在本例中,数据源是一串字符串,需要解析成有意义的数据结构。 - **解析字符串**:根据字符串的格式,可以使用各种方法进行解析,如使用`Split()`方法分隔字符串,或者使用正则表达式提取信息。 - **填充DataTable...

    TDMS转换为EXCEL.rar_TDMS_labview excel_tdms 用excel打开_tdms 转 excel_t

    标题中的“TDMS转换为EXCEL.rar”表明这是一个关于将TDMS(Thermo Fisher Scientific's Data Management System)格式的数据文件转换成Excel电子表格格式的压缩包。TDMS是一种由Thermo Fisher Scientific公司开发的...

    datagirdview中的数据快速导成excel表

    在IT领域,特别是软件开发与数据处理中,将数据从应用程序导出至Excel是一种常见的需求。这不仅便于数据的进一步分析、编辑或分享,还能利用Excel强大的数据处理能力。本篇将深入探讨如何使用Visual Basic(VB)语言...

    将excel文件导成mysql文件

    ### 如何将Excel文件导入MySQL数据库 在进行数据管理和分析时,经常需要将Excel文件中的数据导入到MySQL数据库中,以便于进一步的数据处理与查询。本文将详细介绍如何通过编程方式实现这一过程,并对示例代码进行...

    将GridView列表当中的数据导成Excel

    ### 将GridView列表数据导出至Excel:ASP.NET与C#实现 在现代Web开发中,数据导出功能是企业级应用中常见的需求之一,尤其是将数据导出为Excel格式,便于用户进行进一步的数据分析或存档。本文将详细介绍如何在ASP...

    java excel中表格导成png图片

    在Java编程环境中,将Excel表格转换为PNG图片是一项常见的需求,尤其在数据可视化或报告生成时。本篇文章将深入探讨如何使用Java实现这一功能,主要涉及Apache POI库的运用和其他相关技术。 Apache POI是一个强大的...

    cocos可用excel导表工具

    "cocos可用excel导表工具"就是为了解决这个问题,它允许开发者通过Python脚本将Excel数据转换成Cocos引擎可以直接使用的Lua、JSON或JS文件格式。 这个工具的核心功能包括: 1. **Excel到Lua/JSON/JS转换**:Python...

    GOOGLE导出excel数据-通用版V2.0_KMLtoexcel_excel_V2_

    "这表明这个工具或方法可能专注于将KML文件中的地理信息转换成Excel表格,但它的功能可能相对基础,可能不涵盖所有复杂的KML数据结构。这意味着在实际使用时,用户可能需要测试其兼容性和效果,特别是对于那些包含...

    excel 导成js或json工具

    "excel 导成js或json工具"正是为了解决这个问题,它能够帮助用户将Excel文件中的数据转换为JS或JSON格式,以便于集成到Web应用中。 Excel到JSON的转换过程涉及以下几个关键知识点: 1. **数据结构理解**:首先,...

    PyPI 官网下载 | nestap_excel_create-1.0.0.tar.gz

    通过这些方式,我们可以掌握如何安装、导入库,以及如何利用其提供的API来创建和操作Excel文件。此外,了解库的社区支持、更新频率和问题报告等也是评估其可靠性和适应性的重要因素。 总的来说,"nestap_excel_...

    通用表导出成excel

    vb做的数据库表导出成excel,只要修改下连接方式编译就可以了,非常好用,可以做为erp辅助软件,但是一定要熟悉表名哦,呵呵

    EXT导成个excel的

    在ext grid中导入excel的js文件

    Excel到Lua转表工具

    《Excel到Lua转表工具详解》 在编程领域,数据管理是至关重要的环节,而Excel作为数据处理的常用工具,其灵活性和易用性深受广大用户的喜爱。然而,在游戏开发或者自动化脚本编写中,我们可能需要将Excel的数据转换...

Global site tag (gtag.js) - Google Analytics