OAF_文件系列12_实现OAF导出PDF方式TemplateHelper
ap.paymentrequest.webui
PaymentRequestSignCO
http://wenku.baidu.com/link?url=ujbT5CHkeC1bAtUn9Nsm_FgVB4k4nAWwwlphukyPGKNoPv5cDjRONWAZmf6RejggMg9onxIg_Rqi_gKKV665EVffofZ3Ds_IdKh9Y3tsKZq
public void PrintPDF(OAPageContext pageContext, OAWebBean webBean,
CLOB xmlClob, String printType,
String paymentRequestId) {
HttpServletResponse response =
(HttpServletResponse)pageContext.getRenderingContext().getServletResponse();
// Set the Output Report File Name and Content Type
String contentDisposition;
String fileName;
try {
if ("INVOICE".equals(printType)) {
fileName = "后补发票";
} else {
fileName = "付款申请";
}
contentDisposition =
"attachment;filename=" + java.net.URLEncoder.encode(fileName,
"UTF-8") +
paymentRequestId + ".pdf";
response.setHeader("Content-Disposition", contentDisposition);
response.setContentType("application/pdf");
Reader inputReader = xmlClob.getCharacterStream();
OADBTransactionImpl oaTrans =
(OADBTransactionImpl)pageContext.getApplicationModule(webBean).getOADBTransaction();
String templateName = "";
if ("CON".equals(printType)) {
templateName = "XVK_NO_CNT_PAYMENT_REQUEST";
} else if ("INVOICE".equals(printType)) {
templateName = "XVK_ADD_INV_PAYMENT_REQUEST";
} else {
templateName = "XVK_CONTRACT_PAYMENT_REQUEST";
}
TemplateHelper.processTemplate(oaTrans.getAppsContext(), "XVK",
templateName, "zh", "CN",
inputReader,
TemplateHelper.OUTPUT_TYPE_PDF,
null, response.getOutputStream());
response.getOutputStream().flush();
response.getOutputStream().close();
} catch (Exception e) {
response.setContentType("text/html");
throw new OAException(e.getMessage(), OAException.ERROR);
}
pageContext.setDocumentRendered(false);
}
OAF_文件系列12_实现OAF导出PDF方式TemplateHelper的更多相关文章
- OAF_文件系列2_实现OAF导出CSV格式文件ExportButton(案例)
20150727 Created By BaoXinjian
- OAF_文件系列6_实现OAF导出XML文件javax.xml.parsers/transformer(案例)
20150803 Created By BaoXinjian
- OAF_文件系列10_实现OAF将数据资料导出Excel到本地JXL(案例)
20150729 Created By BaoXinjian
- OAF_文件系列7_实现OAF处理Excel的JXL包介绍(概念)
20150714 Created By BaoXinjian
- OAF_文件系列4_实现OAF上传显示数据库动态图片Image(案例)
20150805 Created By BaoXinjian
- OAF_开发系列12_实现OAF开发中URL中的标记和加密参数传递(案例)
20150712 Created By BaoXinjian
- OAF_文件系列11_实现OAF读写Excel包JXL和POI的区别(概念)
20150803 Created By BaoXinjian
- OAF_文件系列5_实现OAF解析XML文件javax.xml.parsers(案例)
20150729 Created By BaoXinjian
- OAF_文件系列3_实现OAF多行表中附件功能AttachmentImage(案例)
20150727 Created By BaoXinjian
随机推荐
- 项目中创建单元测试—VS2012
我们在每个项目的开发过程中,开发完一个功能,自己首先需要测试一下,VS提供了很方便的测试功能,可以很容易的创建单元测试,但是在VS2012中类名上点击右键没有『创建单元测试』这个菜单,需要先进行设置一 ...
- Binary Tree Postorder Traversal
Given a binary tree, return the postorder traversal of its nodes' values. For example:Given binary t ...
- java常用IO流数据流小结
类名 常用方法 说明 输入流 InputStream int read(); 只能读字节流,虽然返回值是int,但只有低8位起作用. DataInputStream Type readType() ...
- sql 查看数据库物理文件路径
方式一:用于查询all数据库,适用于SQL2005及以上版本. USE [Master] GO /****** 对象 : Table [dbo].[Master] 脚本日期 : 06/29/2 ...
- java的https请求解决证书问题
package sqr.srchSpider.utils; import java.security.SecureRandom; import java.security.cert.Certifica ...
- 架设lamp服务器后,发现未按照 Apache xsendfile模块,
今天在架设lamp服务器后,发现apache 未按照xsendfile模块,于是查找资料按照如下: 安装apache xsendfile模块yum install mod_xsendfile
- uva1635
/* 哑元 组合数的递推整除判断_________________________________________________________________________________ #i ...
- 关于SQL Cookbook里dept与emp表结构以及数据
用MYSQL 写了一下,将number变成int, to_date去掉即可. DROP TABLE IF EXISTS `dept`; CREATE TABLE `dept` ( `DEPTNO` ) ...
- Async/Await - Best Practices in Asynchronous Programming
https://msdn.microsoft.com/en-us/magazine/jj991977.aspx Figure 1 Summary of Asynchronous Programming ...
- RET2LIBC 练习(3) -- VIRTUALALLOC
国庆假期没事做了几道pwn题练手,等有时间在贴出pwn题的分析. 利用VIRTUALALLOC的方法绕过DEP其实和之前的方法大同小异了,只是VIRTUALALLOC开辟了一段新的可执行的内存空间,然 ...