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
随机推荐
- CTO干点啥?
1.负责技术 2.负责人才 3.负责业务(需求) 4.负责组织
- 关于MOOC的学习总结
20125133 马国祥 原创作品转载请注明出处 + <Linux内核分析>MOOC课程http://mooc.study.163.com/course/USTC-1000029000 对 ...
- Linux 和 Windows 常用工具列表
1. Windows 篇 1)MobaItem 一款优秀的Windows下模拟Linux Terminal工具,同时也可以用来远程Linux服务器. 2. Linux 篇 2) MC Linux下非常 ...
- 吴奇隆刘诗诗婚礼场地:巴厘岛Ayana酒店,美到窒息!
导读:忍不住转载一下,原文地址:http://www.sjq315.com/news/270768.html 3月20日,吴奇隆和刘诗诗在巴厘岛五星级酒店Ayana Resort and Spa酒店举 ...
- 学习 Local Sensitive Hash
1. 最近邻法的应用 1.1 Jaccard 相似集 如何定义相似:即相关属性交集的大小,越大则越相似.我们给相似一个数学上的定义:Jaccard 相似集. 集合 \(S\) 与集合 \(T\) 的 ...
- [WARNING]考前必读?!
考试策略很重要. 1) 认真读懂每道题,把题意搞明白,把样例算出来,把题目要求的细节标出. 2) 推出每道题的模型,确定每道题的策略,是部分分还是要全部 ...
- sae flask 微信公众平台开发
index.wsgi启动服务文件 import sae from evilxr import app application = sae.create_wsgi_app(app) evilxr.py ...
- 《java编程思想》读书笔记 暂停一段时间,改为上面的练习题
发现个很尴尬的现象.我一天实在看得太快了...全写下 写博客都得一晚上.. 之前因为是第一次看这么厚的书,别人都说很难,以为会看很慢的.然而,已经完全学过Java的 我感觉没啥压力,越看越快....第 ...
- PHP开发工具
“工欲善其事,必先利其器”,进行PHP开发,选择一个合适的开发工具是必要的. 1.Zend Studio 如果对PHP开发工具进行一个排名,Zend Studio一定是当之无愧的第一名.它来自Zend ...
- Quant的笑话
Q) Why was the FX quant so unlucky with the ladies?A) Because he always kept his dates short. Q) Why ...