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
随机推荐
- Caffe 源碼閱讀(六) InternalThread
类InternalThread是一个虚类,是Caffe中的多线程接口,其本质是为封装了boost::thread 看源码可以得到以下结论: 1.每个派生类都需要实现一个InternalThreadEn ...
- input点击链接另一个页面,各种操作
1.链接到某页<input type="button" name="Submit" value="确 定" class="b ...
- sql developer 要求输入jdk地址
困扰了好久 终于找到解决办法了. 将sql developer改为 兼容模式和管理员方式运行,选择java.exe的路径 终于可以在64位系统下顺利使用了.
- ios网络知识
http://www.cocoachina.com/bbs/read.php?tid-31300.html 启蒙内容 http://blog.csdn.net/nono_love_lilith/ar ...
- javaEE-----org.springframework.dao.InvalidDataAccessApiUsageException: Write operation
org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read ...
- iOS 按钮点击变色
之前一直以为是要在selected状态下增加一个背景图片,效果是颜色变深,明明我的图片是变浅: 之后试了用hightlighted 成功. [_loginBtn setBackgroundImage: ...
- CSS样式--实际开发总结
1. div 嵌套,子div中内容超出范围可以设置: display:inline-block; overflow:auto 即可让子div中出现滚轴 2. 让div中内容垂直方向居中 设置: ...
- http://note.youdao.com/yws/public/redirect/share?id=2bc2dc6c7df6013e9f8106c005da999a&type=false
Welcome to MarkdownPad 2 MarkdownPad is a full-featured Markdown editor for Windows. Built exclusive ...
- HTML5学堂,感谢您一年的陪伴(上)
在HTML学堂将满一周岁之际,感谢再过去的一年里支持和关注它的每一个小伙伴.有了你们的支持,HTML5学堂才能更好的走下去.我们将会把这一年的积累重新体现在HTML5学堂的官网上.HTML5学堂将会全 ...
- MyEclipse黑色主题
第一步:打开链接http://www.eclipsecolorthemes.org/选中一款:下载其中的epf格式. 如图: 在eclipse中打开:file > import > Gen ...