14 Replies Latest reply on Oct 9, 2007 11:56 AM by 555256

    Generate Pdf Report using OAF

    583651
      Hi,
      I need to generate Pdf Report using OAF.. I dont know how to generate Pdf reports..
      Can anyone help me to do it using OAF..
      Please tell me what steps i need to use and any jar files required for doing it...

      Thanks,
      Babu
        • 1. Re: Generate Pdf Report using OAF
          555256
          Babu,
          There is a open source java pdf library, you can use that.Here is the link:
          http://www.lowagie.com/iText/index.html
          --Mukul                                                                                                                                                                                                                                                                                                                                                           
          • 2. Re: Generate Pdf Report using OAF
            Avaneesh Jain
            This issue alredy discuss on this forum.
            Check XML Pub Guide : Chapter 12
            • 3. Re: Generate Pdf Report using OAF
              583651
              Hi,
              Thanks for your early reply, I have gone through the link http://www.lowagie.com/iText/index.html . But i did not get an idea of how to proceed with OAF. and can u tell me where should i check XML Pun Guide : Chapter 12.
              Can we use Jasper Reports in OAF?

              Thanks,
              Babu
              • 4. Re: Generate Pdf Report using OAF
                Avaneesh Jain
                You can find out xml publisher guide on metalink
                • 5. Re: Generate Pdf Report using OAF
                  557833
                  Babu,

                  Check this thread Re: How to show pdf file to customer via OAF - urgent

                  --Shiv                                                                                                                                                                                                                       
                  • 7. Re: Generate Pdf Report using OAF
                    555256
                    Babu,
                    The link i have given, just go through it carefully, you will find sample codes too on that side for generating pdf on the fly. Basically, its a way how you can write pdf file from a java program.
                    You can also go through the threads mentioned to know how to do it via xml publisher.
                    --Mukul                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
                    • 8. Re: Generate Pdf Report using OAF
                      552232
                      Hi ,

                      I have tried the sample provided by kganta ... but i am unable to import the following classes

                      Properties class .. i have found a Interface in oracle.jbo.properties
                      Hastable .. i found Hashtable in oracle.jbo.Hashtable but when i import that
                      it says methord DataTemplate::setParameters(oracle.jbo.Hastable) dosent
                      exists
                      DocumentHelper class .. i was not able to find the documenthelper class

                      Can you please send the details ....

                      Thanks
                      Tom...
                      • 9. Re: Generate Pdf Report using OAF
                        552232
                        Hi Guys ,

                        I found the classes the DocumentHelper class is found in

                        oracle.apps.xdo.oa.common.DocumentHelper

                        The properties class was in java.util.properties

                        I compiled the code and when i run it i get the following exception

                        oracle.apps.fnd.framework.OAException: Application: FND, Message Name: SYSTEM-ERROR. Tokens: MESSAGE = Io exception: Got minus one from a read call; (Could not lookup message because there is no database connection)
                             at oracle.apps.fnd.framework.server.OAExceptionUtils.processAOLJErrorStack(OAExceptionUtils.java:988)
                             at oracle.apps.fnd.framework.server.OAUtility.getWebAppsContext(OAUtility.java:352)
                             at oracle.apps.fnd.framework.CreateIcxSession.getEncryptedSessId(CreateIcxSession.java:144)
                             at oracle.apps.fnd.framework.CreateIcxSession.createSession(CreateIcxSession.java:80)
                             at runregion.jspService(runregion.jsp:96)
                             at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
                             at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
                             at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
                             at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
                             at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
                             at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
                             at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
                             at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
                             at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
                             at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
                             at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:797)


                        I get the exception at this point in the code :

                        String dataDefCode = "DTFEMP" ;
                        String dataDefApp = "CIE";
                        DataTemplate datatemplate = new DataTemplate(((OADBTransactionImpl)getOADBTransaction()).getAppsContext(), dataDefApp,dataDefCode );


                        Thanks
                        Tom...
                        • 10. Re: Generate Pdf Report using OAF
                          55166
                          Import com.sun.java.util.collections.Hashtable;

                          Oracle is still using the old Collection classes.

                          Regards,
                          Ravi.
                          • 11. Re: Generate Pdf Report using OAF
                            552232
                            Hi Ravi,

                            Thanks for the reply .. i am able to import everything and compile it but when i try to create a PDF i get the following exception

                            oracle.apps.fnd.framework.OAException: oracle.jbo.JboException: JBO-29000: Unexpected exception caught: java.lang.NoClassDefFoundError, msg=oracle/apps/xdo/dataengine/DataProcessor

                            can you put some light on this ... do i need to do something while creating the datatemplate ....

                            Thanks
                            Tom...
                            • 12. Re: Generate Pdf Report using OAF
                              Avaneesh Jain
                              You can take this class from instance it would be in $JAVA_TOP/oracle/apps/xdo/dataengine/DataProcessor , Put this class in your myclasses folder.

                              Thanks
                              • 13. Re: Generate Pdf Report using OAF
                                583651
                                Hi,

                                I need to download the pdf report file which is not saved in database..
                                i used the following code ..

                                OAMessageDownloadBean downloadBean =(OAMessageDownloadBean)createWebBean(pageContext, MESSAGE_DOWNLOAD_BEAN);
                                downloadBean.setViewUsageName("XXGSTaskListUpdProgTableVO1");
                                downloadBean.setViewAttributeName("ProjectName");
                                downloadBean.setContentViewAttributeName("TaskName");
                                downloadBean.setFileContentType("pdf");
                                OADataBoundValueViewObject contentBoundValue = new OADataBoundValueViewObject(downloadBean, "pdf");
                                downloadBean.setAttributeValue(FILE_CONTENT_TYPE, contentBoundValue);
                                downloadBean.setPrompt("dynamic download");
                                webBean.addIndexedChild(downloadBean);


                                But i am getting the following error in the last line..

                                oracle.apps.fnd.framework.OAException: Application: FND, Message Name: FND_WEBBEAN_ACCESS_RESTRICTED. Tokens: CALL_STACK = java.lang.Throwable


                                Please tell me how to download a pdf report file which is not saved in database..

                                Regards,
                                Babu
                                • 14. Re: Generate Pdf Report using OAF
                                  555256
                                  Babu,
                                  OAMessageDownloadBean can only be used if your report is of type BLOB i.e. saved in DB. Otherwise, if if you want to give link to pdf, to open from server, see this link:
                                  http://kb.adobe.com/selfservice/viewContent.do?externalId=317300

                                  If this is generated from a concurrent program, see this thread:
                                  How to open a file using OAF
                                  --Mukul