使用XML Publisher导出PDF报表

生成XML数据源有两种方式。

一种是使用存储过程,返回一个clob作为xml数据源。

另一种是直接使用VO中的数据生成xml数据源。

方法一参考:

Oracle XML Publisher技巧集锦

OAF与XML Pulisher集成

方式二:

CO

if ( "PrintDis".equals(l_enent))
    {
      String DistributionId = pageContext.getParameter("DistributionId");
      parameters = new Serializable[] { DistributionId };
      XMLNode xmlNode = (XMLNode) am.invokeMethod("OnlyPrintDis", parameters);
      PrintDisPDF(pageContext, webBean, xmlNode, DistributionId);
    }

AM

public XMLNode OnlyPrintDis(String DistributionId) {
     ChgDisPrintTmpVOImpl vo = getChgDisPrintTmpVO1();
     vo.clearCache();
     vo.initQuery(keyId);
     vo.executeQuery();
     XMLNode xmlNode = 
         ((XMLNode)vo.writeXML(4, XMLInterface.XML_OPT_ALL_ROWS));
     return xmlNode;
 }
原文地址:https://www.cnblogs.com/huanghongbo/p/4757031.html