`
terry0501
  • 浏览: 306508 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

导出Word

 
阅读更多
<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="http://www.bstek.com/dorado" prefix="d"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>科技管理平台</title>
<link href="<%=request.getContextPath()%>/css/common.css"
rel="stylesheet" type="text/css" />
<script type="text/javascript">
function autoclick() {
document.getElementById("t4").click();

}
</script>
</head>
<body onload="javascript:autoclick();">
<jsp:include page="/div.jsp" />
<div id="container">
<jsp:include page="/top2.jsp" />

<div id="mainContent">
<div id="sidebar">
<jsp:include page="/left.jsp" />
<div id="sidebar2">
<div id="content" style="height: 400px;">
<div class="daohang">
<b>首页 - 事件管理 - 事件详细</b>
</div>
<div class="tittle"></div>

<d:View config="com.heda.kjgl.client.event.eventDetail">
<d:Layout type="vflow" width="97%">
<d:Pane>
<d:AutoForm id="formEventBase" /><br>
<div align="center">
<d:Button id="buttonBack" />&nbsp;&nbsp;
<d:Button id="buttonExport" />
</div>
<d:DataTable id="tableEventResList" />
</d:Pane>
<d:Pane height="8px">
</d:Pane>
</d:Layout>

</d:View>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
<script type="text/javascript">
function doExport2word(){
//../common/testword.jsp
var cur=datasetEventBase.getCurrent();
if(cur!=null){
var prId=cur.getValue("prId");//分行事件单号
var hdId=cur.getValue("hdId");//IT服务台单号
var prTitle=cur.getValue("prTitle");//事件名称
var prImpact=cur.getValue("prImpact");//影响度
var logTime="";
var tmp=cur.getValue("logTime");//请求时间
if(tmp!=null&&tmp!=""){
var date=new Date(tmp);
logTime=date.getYear()+"-"+(date.getMonth()*1+1)+"-"+date.getDate()
}
var prCategoryId=cur.getValue("prCategoryId");//类型ID
var prCategory=cur.getValue("prCategory");//类型一级
var prType=cur.getValue("prType");//类型二级
var prItem=cur.getValue("prItem");//类型三级
var prDesc=cur.getValue("prDesc");//事件描述
window.location.href="exportEventDetail2word.jsp?prId="+prId
                                            +"&hdId="+hdId
                                            +"&prTitle="+prTitle
                                            +"&prImpact="+prImpact
                                            +"&logTime="+logTime
                                            +"&prCategoryId="+prCategoryId
                                            +"&prCategory="+prCategory
                                            +"&prType="+prType
                                            +"&prItem="+prItem
                                            +"&prDesc="+prDesc;
}
}
</script>



<%@page contentType="application/msword"%>

<%
//response.setContentType( "Application;charset=GB2312");
response.setHeader("Content-Disposition","attachment;filename=temp.doc");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>详细信息</title>
</head>
<body>
<div><B>详细信息:</B></div>
<div>
    <table border="1" width="80%" align="left" cellpadding="2" cellspacing="1" cellpadding="1" cellspacing="1" >
    <tr bgcolor="#FFFFFF">
    <td align="right" width="120">分行事件单号:</td>
    <td colspan="2"><%=request.getParameter("prId")%></td>
    <td align="right" width="120">IT服务台单号:</td>
    <td colspan="2"><%=request.getParameter("hdId")%></td>
    </tr>
    <tr bgcolor="#FFFFFF">
    <td align="right" width="120">事件名称:</td>
    <td colspan="2"><%=request.getParameter("prTitle")%></td>
    <td align="right" width="120">影响度 :</td>
    <td colspan="2"><%=request.getParameter("prImpact")%></td>
    </tr>
   
    <tr bgcolor="#FFFFFF">
    <td align="right" width="120">请求时间:</td>
    <td colspan="2"><%=request.getParameter("logTime")%></td>
    <td align="right" width="120">类型ID:</td>
    <td colspan="2"><%=request.getParameter("prCategoryId")%></td>
    </tr>
    <tr bgcolor="#FFFFFF">
    <td align="right" width="120">类型一级:</td>
    <td colspan="1"><%=request.getParameter("prCategory")%></td>
    <td align="right" width="120">类型二级:</td>
    <td colspan="1"><%=request.getParameter("prType")%></td>
    <td align="right" width="120">类型三级:</td>
    <td colspan="1"><%=request.getParameter("类型三级 ")%></td>
    </tr>
    <tr bgcolor="#FFFFFF" >
    <td align="right" width="120" rowspan="2">事件描述:</td>
    <td colspan="5" rowspan="2"><%=request.getParameter("prDesc")%></td>
    </tr>
  </table>
</div>
  <br/>
</body>
</html>




分享到:
评论
1 楼 zhemin5754 2011-11-24  
导出的word修改后会有问题,会生成新的文件夹和文件。

相关推荐

Global site tag (gtag.js) - Google Analytics