apzl_leasing/WebContent/AppConfig/EDoc/TemplateViewExample.jsp
2018-06-03 22:26:41 +08:00

32 lines
1.5 KiB
Plaintext

<%@ page contentType="text/html; charset=GBK"%>
<%@page import="com.amarsoft.app.edoc.EDocument"%>
<%@ include file="/IncludeBegin.jsp"%>
<html>
<body>
<iframe name="MyAtt" src="<%=sWebRootPath%>/Blank.jsp?TextToShow=ÕýÔÚÏÂÔØ¸½¼þ£¬ÇëÉÔºò..." width=100% height=100% frameborder=0 hspace=0 vspace=0 marginwidth=0 marginheight=0 scrolling="no"> </iframe>
</body>
</html>
<%
String sEDocNo = DataConvert.toString((String)CurComp.getParameter("EDocNo"));
BizObject bo = JBOFactory.createBizObjectQuery("jbo.edoc.EDOC_DEFINE",
"select ContentTypeFmt,FullPathFmt,FullPathDef from O where EDocNo='"+sEDocNo+"'").getSingleResult(false);
String sContentType = bo==null?"":bo.getAttribute("ContentTypeFmt").getString();
String sFullPathFmt = bo==null?"":bo.getAttribute("FullPathFmt").getString();
String sFullPathDef = bo==null?"":bo.getAttribute("FullPathDef").getString();
int index = sFullPathFmt.indexOf('.');
String sOutName = sFullPathFmt.substring(0,index)+"OUT"+sFullPathFmt.substring(index);
System.out.println("OutName:"+sOutName);
EDocument edoc = new EDocument(sFullPathFmt,sFullPathDef);
edoc.saveAsDefault(sOutName);
%>
<form name=form1 method=post action="<%=sWebRootPath%>/servlet/view/attachment?CompClientID=<%=sCompClientID%>">
<div style="display:none">
<input name=filename value="<%=sOutName%>">
<input name=contenttype value="<%=sContentType%>">
<input name=viewtype value="view">
</div>
</form>
<script type="text/javascript">
form1.submit();
</script>
<%@ include file="/IncludeEnd.jsp"%>