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的更多相关文章

  1. OAF_文件系列2_实现OAF导出CSV格式文件ExportButton(案例)

    20150727 Created By BaoXinjian

  2. OAF_文件系列6_实现OAF导出XML文件javax.xml.parsers/transformer(案例)

    20150803 Created By BaoXinjian

  3. OAF_文件系列10_实现OAF将数据资料导出Excel到本地JXL(案例)

    20150729 Created By BaoXinjian

  4. OAF_文件系列7_实现OAF处理Excel的JXL包介绍(概念)

    20150714 Created By BaoXinjian

  5. OAF_文件系列4_实现OAF上传显示数据库动态图片Image(案例)

    20150805 Created By BaoXinjian

  6. OAF_开发系列12_实现OAF开发中URL中的标记和加密参数传递(案例)

    20150712 Created By BaoXinjian

  7. OAF_文件系列11_实现OAF读写Excel包JXL和POI的区别(概念)

    20150803 Created By BaoXinjian

  8. OAF_文件系列5_实现OAF解析XML文件javax.xml.parsers(案例)

    20150729 Created By BaoXinjian

  9. OAF_文件系列3_实现OAF多行表中附件功能AttachmentImage(案例)

    20150727 Created By BaoXinjian

随机推荐

  1. 19、lambda表达式树

    一.定义: 表达式树又称为表达式目录树,以数据形式表示语言级代码.所有的数据都存储在树结构中,每个结点表示一个表达式(Expression). 二.要点: –Lambda表达式的参数类型可以忽略,因为 ...

  2. MSP430 IO 使用

    MSP430内部上拉下拉使用注意——IO口测高低电平     MSP430单片机IO口用来检测高低电平时,是不需要外部上拉下拉的,因为其内部有上拉和下拉.在用作高低电平检测时,需要开启上拉或下拉.   ...

  3. Word Break II

    Given a string s and a dictionary of words dict, add spaces in s to construct a sentence where each ...

  4. 关于 Record & TList 的一点吐槽

    需求是把record 保存在TList中,并可以随时改变TList中Items的各项值. 代码很简单: MyRec = record MyStr: string; constructor Create ...

  5. http 学习 1-2 chapter2-URL与资源

    URL是因特网资源的标准化名称.URL指向每一条电子信息,告诉他们位于何处,以及如何与之进行交互. URL语法,以及各种URL组件的含义及其所做的工作. 很多Web客户端都支持额URL快捷方式,包括相 ...

  6. “添加到收藏夹”功能(share)

    以下分享自: 如何给网站增加“添加到收藏夹” 给网站添加“添加到收藏夹”理论上应该是很简单的事情,但是受到各种浏览器和操作系统的不一致的问题,使得这个问题异常的繁琐啊. 下面是梳理的一些资料,仅供参考 ...

  7. 安装 modelsim 10.4

    安装教程: http://jingyan.baidu.com/article/da1091fb30d880027849d63a.html 在安装的过程中出现cmd乱(即在输入页面上停留字符),还有吱吱 ...

  8. Please allow Subclipse team to receive anonymous usage statistics for this Eclipse intance(info)

    本文转载自:http://blog.csdn.net/myfxx/article/details/21096949 今天在用eclipse启动项目的时候发现了一个问题,就是每次启动项目的时候,ecli ...

  9. 字符串与json对象之间转换

    var data='{"1":"","2":"two"}' 原生 eval  eval('('++')') JSON.p ...

  10. React(JSX语法)----动态UI

    1.React honws how to bubble and capture events according to the spec,and events passed to your event ...