Login
Register

Home

Trainings

Fusion

R12

Blogs

Contact Us

Prabhakar Somanathan
  • Register

Oracle Gold Partners, training schedule is listed here designed by Five Star Rated Oracle Press Authors & Oracle ACE's.

webinar new Click here to raise Support Ticket. Get reply within 48 hours.

User Rating: 4 / 5

Star ActiveStar ActiveStar ActiveStar ActiveStar Inactive
 

The oracle applications is continuously evolving with the use of new technologies.
It is shifting from a traditional form based application to a self service web based application using Oracle Applications Framework (OAF) .
Every application requires a seamless integration with the reporting tools.
OA Framework seamlessly integrates with XML Publisher to fulfill the Oracle Applications reporting requirement.
In this article we will discuss in detail the integration of OA Framework and XML Publisher with an example.

It is assumed that the reader has basic understanding of OA Framework and XML Publisher.

The article has the following section
1) XML Publisher Architecture
2) Designing the OAF BC4J Data Model.
3) Designing the OAF Page and generating the Data XML
4) Designing the RTF Template using Data XML
5) Registering the Template with Oracle Applications.
6) Integrating the OAF page With XML Publisher.
7) Invoking the report from OAF

Step 1 : XML Publisher Reporting Architecture



An XML publisher report consist of a report template designed in RTF or PDF Formatand a Data XML file. The template contains the report layout. During execution the Data XML File is merged with the template to generate a PDF, HTML, EXCEL or RTF report.
Step 2: Designing the OAF BC4J Data Model.
Using jdeveloper create a ViewObject EmpVO using the below query and associate it to ApplicationModule EmpAM.

SELECT empno,ename,job,mgr,hiredate,comm,deptno FROM emp

The Jdevloper should look like this


Step 3 : Generating the XML for Template Design
Design a OAF Page EmpPG with the Following Code in the Controller EmpCO.

EmpCO :

public void processRequest(OAPageContext pageContext, OAWebBean webBean)
{
super.processRequest(pageContext, webBean);
OAApplicationModuleImpl am= (OAApplicationModuleImpl)pageContext.getApplicationModule(webBean);
am.invokeMethod("initEmpVO");
am.invokeMethod("getEmpDataXML");
}
EmpAMImpl :

public void initEmpVO()
{
EmpVOImpl vo = getEmpVO1();
if(vo == null)
{
MessageToken errTokens[] = {
new MessageToken("OBJECT_NAME", "EmpVO1")
};
throw new OAException("AK", "FWK_TBX_OBJECT_NOT_FOUND", errTokens);
} else
{
vo.executeQuery();
}
}
public void getEmpDataXML()
{
try {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
OAViewObject vo = (OAViewObject)findViewObject("EmpVO1");
((XMLNode) vo.writeXML(4, XMLInterface.XML_OPT_ALL_ROWS)).print(outputStream);
System.out.println(outputStream.toString());
}
catch(Exception e)
{
throw new OAException (e.getMessage());
}
}
On running the page , the data xml file will be printed on the Jdeveloper Embeded OC4J Sever Log (since i have used System.out.println). The XML file will be like
<EmpVO>
<EmpVORow>
<Empno>7369</Empno>
<Ename>SMITH</Ename>
<Job>CLERK</Job>
<Mgr>7902</Mgr>
<Hiredate>1980-12-17</Hiredate>
<Deptno>20</Deptno>
</EmpVORow>
<EmpVORow>
<Empno>7499</Empno>
<Ename>ALLEN</Ename>
<Job>SALESMAN</Job>
<Mgr>7698</Mgr>
<Hiredate>1981-02-20</Hiredate>
<Comm>300</Comm>
<Deptno>30</Deptno>
</EmpVORow>
<EmpVORow>
<Empno>7521</Empno>
<Ename>WARD</Ename>
<Job>SALESMAN</Job>
<Mgr>7698</Mgr>
<Hiredate>1981-02-22</Hiredate>
<Comm>500</Comm>
<Deptno>30</Deptno>
</EmpVORow>
</EmpVO>
Step 4 : Designing the Template

Install the Oracle XML Publisher Desktop available via patch 5887917. Open the Microsoft word. You should be able to see the following menus and toolbars.
Using the menu Data -> Load XML Data... , load the XML File generated from Jdeveloper
If the XML files gets loaded successfully, then you should get the below confirmation.


Using the Table Wizard as below to create the 'Table Report Format' with all the columns of EMP.
The Table Report Format Template should be like
Save the document as Emp.rtf. Preview the report as PDF, XML, HTMl or RTF.
Step 5 : Registering the Template with Oracle Applications.
Login with a user having "XML Publisher Administrator" Responsibility.Navigate to Home --> Data Definition and define the data definition.

Navigate to Home --> Template and Define the Template
Step 7 : Integrating the OAF page With XML Publisher
Design the EmpPG page to appear as shown below.



Set the Action Type and Event property of the Tourch Image Item to FireAction and GenerateReport respectively. Modify the Controller and ApplicationModule as below

Imports :
import oracle.xml.parser.v2.XMLNode;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import oracle.apps.xdo.XDOException;
import oracle.apps.xdo.oa.schema.server.TemplateHelper;
import oracle.cabo.ui.data.DataObject;
import oracle.jbo.XMLInterface;

EmpCO :
private static final int DEPTH = 4;
private static final int APP_ID = 20035;
private static final String APP_NAME = "XXIGS";
private static final String TEMPLATE_CODE = "Emp_Template";
private static final int BUFFER_SIZE = 32000;

public void processRequest(OAPageContext pageContext, OAWebBean webBean)
{
super.processRequest(pageContext, webBean);
OAApplicationModuleImpl am= (OAApplicationModuleImpl)pageContext.getApplicationModule(webBean);
am.invokeMethod("initEmpVO");
}
public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
{
super.processFormRequest(pageContext, webBean);
OAApplicationModuleImpl am= (OAApplicationModuleImpl)pageContext.getApplicationModule(webBean);

String event = pageContext.getParameter("event");
if("GenerateReport".equals(event))
{

// Get the HttpServletResponse object from the PageContext. The report output is written to HttpServletResponse.
DataObject sessionDictionary = (DataObject)pageContext.getNamedDataObject("_SessionParameters");
HttpServletResponse response = (HttpServletResponse)sessionDictionary.selectValue(null,"HttpServletResponse");
try {
ServletOutputStream os = response.getOutputStream();

// Set the Output Report File Name and Content Type
String contentDisposition = "attachment;filename=EmpReport.pdf";
response.setHeader("Content-Disposition",contentDisposition);
response.setContentType("application/pdf");

// Get the Data XML File as the XMLNode
XMLNode xmlNode = (XMLNode) am.invokeMethod("getEmpDataXML");
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
xmlNode.print(outputStream);
ByteArrayInputStream inputStream = new ByteArrayInputStream(outputStream.toByteArray());
ByteArrayOutputStream pdfFile = new ByteArrayOutputStream();

//Generate the PDF Report.
TemplateHelper.processTemplate(
((OADBTransactionImpl)pageContext.getApplicationModule(webBean).getOADBTransaction()).getAppsContext(),
APP_NAME,
TEMPLATE_CODE,
((OADBTransactionImpl)pageContext.getApplicationModule(webBean).getOADBTransaction()).getUserLocale().getLanguage(),
((OADBTransactionImpl)pageContext.getApplicationModule(webBean).getOADBTransaction()).getUserLocale().getCountry(),
inputStream,
TemplateHelper.OUTPUT_TYPE_PDF,
null,
pdfFile);

// Write the PDF Report to the HttpServletResponse object and flush.
byte[] b = pdfFile.toByteArray();
response.setContentLength(b.length);
os.write(b, 0, b.length);
os.flush();
os.close();
}
catch(Exception e)
{
response.setContentType("text/html");
throw new OAException(e.getMessage(), OAException.ERROR);
}
pageContext.setDocumentRendered(false);
}

EMpAMImpl :

public void initEmpVO()
{
EmpVOImpl vo = getEmpVO1();
if(vo == null)
{
MessageToken errTokens[] = {
new MessageToken("OBJECT_NAME", "EmpVO1")
};
throw new OAException("AK", "FWK_TBX_OBJECT_NOT_FOUND", errTokens);
} else
{
vo.executeQuery();
}
}
public XMLNode getEmpDataXML()
{
OAViewObject vo = (OAViewObject)findViewObject("EmpVO1");
XMLNode xmlNode = (XMLNode) vo.writeXML(4, XMLInterface.XML_OPT_ALL_ROWS);
return xmlNode;
}


Run the EmpPG page and click on the tourch icon. The File Download window appear. Click on the Open Button to view the report.


.[

Prabhakar Somanathan

Overall Rating (0)

0 out of 5 stars

People in this conversation

  • Guest - kishore Ryali

    Hi Prabhakar
    Good Article. I believe we can levarage this approach to view the output of XMLP report with the user desired output format like Excel/HTML/PDF.
    By providing a LOV to select the output format and change the PFR to set that output to TemplateHelper.processTemplate

    Using this approach we can overcome the restriction to default output (PDF) from SRS.

    Thanks for sharing.

    Short URL:
  • Guest - Ritu

    Hi

    Awesome article. I had been requesting Anil to publish something on this integration for a long time.
    Did you not leverage the XDOCommonRN in your integration?

    This one is actually a better way I think, it provides more flexibility.

    Ritu

    Short URL:
  • Guest - Anil Passi

    Hi Ritu

    Indeed you and others requested this in past.
    But given that I myself had learnt this technique from Prabhakar, I wanted Prabhakar to publish this himelf.

    For those who don't know, when Prabhakar was in Oracle Corp, he had developed various complicated XMLP reports that could be invoked from OAF in realtime.

    Cheers,
    Anil Passi

    Short URL:
  • kishore , you are correct. We can have a message choice for the output format. Based on the selected output type , we can generate the report.

    Ritu, XDO Common region in my understanding should be used when one want to give the end user some data filtering options. Like you can have two regions.

    Region 1 :
    A search Region where u can have UI components to enter the search criteria

    Region 2:
    XDO Common region where you display the report. The report data will be based on the search criteria

    If one wants to get the content of a page say invoice page into a report, then he can use the logic shown in the article.

    I will shortly publish a article for the XDO Common Region

    Thanks
    Prabhakar.S

    Short URL:
  • Guest - Rishi

    when I am trying to compile the above code in EMP CO I am getting the following error : variable TemplateHelper not found in classs

    Short URL:
  • Hi Rishi,
    Import the class oracle.apps.xdo.oa.schema.server.TemplateHelper in the controller. This will be available in $JAVA_TOP/oracle/apps/xdo/oa/schema/server. I would advise you to copy the xdo directry from the $JAVA_TOP and create a zip file and add it to the Project Libraries.

    Thanks,
    Prabhakar.S

    Short URL:
  • Guest - Rakes.jain@gmail.com

    "This will be available in $JAVA_TOP/oracle/apps/xdo/oa/schema/server. I would advise you to copy the xdo directry from the $JAVA_TOP and create a zip file and add it to the Project Libraries."

    pls Explain it step by step ?
    and
    iam not able to run this xdo page from Jdeveloper itslelf.
    can you help me out to achieve that ?

    Short URL:
  • Hi Prabhakar/ Anil,

    I want to create a pdf template instead of rtf template for my report, and make some fields as editable.
    The generated pdf output should have some fields as editable which anyone can fill and save through adobe reader.
    I tried creating such pdf template through adobe acrobat but facing issues. When I create a template through xml publisher admin responsibility and attach my template, it errors out. Also, if I create a rtf template with pdf form fields in it, it generate a static pdf output.

    Any help is greatly appreciated.

    Thanks,
    Dev

    Short URL:
  • I did all the above listed steps . I get prompted to open/save the pdf file . I click on Open, gives me the follwoing error :
    'could not open because it either not a supported file or because the file has been damaged(for example , it was sent as an email attachement and wasnt correctly decoded)'

    Would be glad if you help me debug this error message.
    Thanks
    Jyo

    Short URL:
  • I forgot to mention one more thing above :
    I did all the above listed steps .
    I made it in ak module so i changed private static final int APP_ID = 601;

    I get prompted to open/save the pdf file . I click on Open, gives me the follwoing error :
    'could not open because it either not a supported file or because the file has been damaged(for example , it was sent as an email attachement and wasnt correctly decoded)'

    Would be glad if you help me debug this error message.
    Thanks
    Jyo

    Short URL:
  • Guest - Danny Parrish

    Prabhakar,

    The step where you are getting your XML Data source, would it be possible to define another data source for it that is now part of the page definition? (For example, a Concurrent Request where the output is in XML). Thanks, Danny

    Short URL:
  • Guest - Barozkok

    Hi Prabhakar,
    I try to call a report with data. When I use template and data in English there is no problem. But Template in Turkish containing some characters different from Engilish I can see only the empty template. What can be the reason?
    Thsnks.

    Short URL:
  • Guest - Suresh1784

    Even I am getting the Error!!!!!!!!

    when I try open the PDF file

    could not open because it either not a supported file or because the file has been damaged(for example , it was sent as an email attachement and wasnt correctly decoded

    Please advice what shoud I do?

    Thanks
    Suresh

    Short URL:
  • Guest - Barozkok

    Hi,
    If the template needs two different queries(some fields in report may be repeated), how can I combine two xml data produced by different queries(diiferent view objects)?
    Thanks in advance.

    Short URL:
  • Guest - Dean

    Hi Prabhakar,

    Even I am getting the same error as some above

    when I try open the PDF file

    could not open because it either not a supported file or because the file has been damaged(for example , it was sent as an email attachement and wasnt correctly decoded

    Please advice what shoud I do?

    Thanks,
    Dean

    Short URL:
  • Guest - kishor nagbhire

    hi SHIVA
    i'm a new user of ur site
    can u help me on that topic
    i want record in GL

    '''''' undefined accounting periods in the current accounting calendar '''''''''''

    help me
    thanks

    Short URL:
  • Guest - Sreeramvaskuri

    This article is very good.easily understanding the developer.in that entire code,i didnt understand the below mentioned.
    What exactly use of this code and where do i get a sessionParameters for assigning to this.
    Is it automatically populated,or we have to write some code for this.
    Could you please advice me.how to get these values.
    // Get the HttpServletResponse object from the PageContext. The report output is written to HttpServletResponse.
    DataObject sessionDictionary = (DataObject)pageContext.getNamedDataObject("_SessionParameters");
    HttpServletResponse response = (HttpServletResponse)sessionDictionary.selectValue(null,"HttpServletResponse");

    Short URL:
  • Guest - PrathapReddy K

    Hi Prabhakar,

    I am also getting the same error as "not a supported file or file has been damaged".

    when I try open the PDF file

    could not open because it either not a supported file or because the file has been damaged(for example , it was sent as an email attachement and wasnt correctly decoded

    Please advice what to do?

    Regards--
    Prathapreddy.

    Short URL:
  • Guest - PrathapReddy K

    Hi Prabhakar,

    for the same code I tried to generate HTML type report.
    it is showing the below mentioned error message and query

    No corresponding LOB data found :SELECT L.FILE_DATA FILE_DATA,DBMS_LOB.GETLENGTH(L.FILE_DATA) FILE_LENGTH, L.LANGUAGE LANGUAGE, L.TERRITORY TERRITORY, B.DEFAULT_LANGUAGE DEFAULT_LANGUAGE, B.DEFAULT_TERRITORY DEFAULT_TERRITORY,B.TEMPLATE_TYPE_CODE TEMPLATE_TYPE_CODE, B.USE_ALIAS_TABLE USE_ALIAS_TABLE, B.START_DATE START_DATE, B.END_DATE END_DATE, B.TEMPLATE_STATUS TEMPLATE_STATUS, B.USE_ALIAS_TABLE USE_ALIAS_TABLE, B.DS_APP_SHORT_NAME DS_APP_SHORT_NAME, B.DATA_SOURCE_CODE DATA_SOURCE_CODE, L.LOB_TYPE LOB_TYPE FROM XDO_LOBS L, XDO_TEMPLATES_B B WHERE L.APPLICATION_SHORT_NAME= :1 AND L.LOB_CODE = :2 AND L.APPLICATION_SHORT_NAME = B.APPLICATION_SHORT_NAME AND L.LOB_CODE = B.TEMPLATE_CODE AND (L.LOB_TYPE = 'TEMPLATE' OR L.LOB_TYPE = 'MLS_TEMPLATE') AND ( (L.LANGUAGE = :3 AND L.TERRITORY = :4) OR (L.LANGUAGE = :5 AND L.TERRITORY = :6) OR (L.LANGUAGE= B.DEFAULT_LANGUAGE AND L.TERRITORY= B.DEFAULT_TERRITORY ))

    Also I have a Doubt that where we are assigning the data to the "pdfFile"?

    Regards--
    PrathapReddy

    Short URL:
  • Guest - Sreeramvaskuri

    Hi ,

    I am tried to generate a .Pdf file.It is generating,but without data.
    could you please help me out,where i am wrong.

    Thanks & Regards
    Sreerama Vaskuri

    Short URL:
  • Guest - PrathapReddy K

    Hi Prabhakar,
    I found some sample to call the concurrent programm in the OAF Page.
    I have some doubts, below is the details.


    When I try to call the Concurrent program from my controller class it is showing the following error message

    oracle.apps.fnd.cp.request.RequestSubmissionException: Cannot submit concurrent request for program POSReport
    below is t code I used to call the Concurrent program.

    OAException oaexception1 = null;
    Number number = 123;
    OADBTransaction oadbtransaction = am.getOADBTransaction();
    Vector vector = new Vector();
    vector.addElement(String.valueOf(number));
    try
    {

    ConcurrentRequest concurrentrequest = new ConcurrentRequest(oadbtransaction.getJdbcConnection());
    int i = concurrentrequest.submitRequest("AK", "POSReport", "", null, false, vector);
    oadbtransaction.commit();

    It is exactly giving the error at the calling of the *concurrentrequest.submitRequest*

    Pls advise me how to overcome this.
    Also where can we find the JavaDoc for all these classes?
    Also will it shows the report of the concurrent request after execution?
    Im trying to run this to generate a report.
    I have registered the report In the Apps.
    I want to call that report in the OAF page.

    Regards--
    PrathapReddy

    Short URL:
  • Guest - Eric Smith

    I am getting the same issue as many above, where the PDF will not open. I changed the content-type to application/text and TemplateHelper.OUTPUT_TYPE_PDF to OUTPUT_TYPE_TEXT. After inspecting the data sent back, it appears to be the HTML of the OAF Page generated. Is there a specific version of jdev we should be using?

    Short URL:
  • Guest - Talluri Ajay

    Hi
    I am trying to initantiate a Datatemplate using oracle.apps.xdo.oa.util.Datatemplate for a Data Definition that I have defined earlier.

    Later I have imported xdo directory and included it in the library (using Project settings). Then I was getting an error for oracle.apps.fnd.i18n
    I have imported the same onto my system and included in the library .

    Now I am getting an error saying java.lang.NoSuchMethodError, msg=oracle.apps.fnd.i18n.common.text.resources.CalendarResourceAccessor.getEraResources()

    What could be the reason for this error.
    And apart from the xdo package what other libraries should we import

    Short URL:
  • Guest - Somasekhar

    Hi,

    At present i am wokring EAM Module. Here i need to call one XML Publisher report.
    In my OAF Page one button is there. After clicking this button i need to fire one report(The name of the report is "Maintenance Picking Slip Issued Report").

    Please help me how to call report? I don't have any idea how to proceed for this.please explain clearly.


    Thanks in advance..

    Thanks,
    Somasekhar.


    Thnaks,
    Somasekhar

    Short URL:
  • Guest - PrathapReddy K

    Hi Anil,
    The PDF report is openiing perfectly.
    The problem is we need to add all the fnd and xdo classes in the classes folder when we are trying with JDeveloper, then it is working fine.

    Now my question is can we able to open the PDF Report directly, instead it prompts us for save or open options.

    I think this can be done by modifying the parameters for TemplateHelper.processTemplate method.
    I tried and I am unable to get it. Can you help me regarding this.


    Regards--
    PrathapReddy

    Short URL:
  • Guest - chanu

    Hi,

    How will we print output in XML from OAF page.

    As i cant get the OAF files from the server, what should i do to get output in XML from instance as u said "System.out.println".

    I have Access to XML publisher administrator can i do anything there??\

    Regrards,
    Chanu

    Short URL:
  • Guest - Caleb Heidebrechtt

    I looked through your blog for some basic information on importing FSG output into BI Publisher Enterprise. I didn't see anythign that basic and I am wondering if you have any advice and or links to blogs that could explain this process for me. I am just beginning with this. Thanks for any help you can offer.

    Short URL:
  • Guest - GsrC

    Hi;

    I am able to prepare a xml publisher PDF report with single VO(select query) with the help of above steps where as in my requirement I required to write more then one VO(select querys). Can you give some ideas how to proceed?

    --
    GsrC

    Short URL:
  • Guest - rkumar1836

    Like many Others i am too getting the error when opening the pdf file
    have anyone found the specific reason for this.

    Short URL:
  • Guest - Anitha.veerappa

    I was also getting the file open error "adobe reader could not open the file because it is not a supported file type".

    I uninstalled the Adobe reader, then the page showed me the real reason why it was not working. I was getting the error because I had written the method "getEmpDataXML" in the controller and was trying to call it from AM just like how the code here is doing. Once I got the exact error, I fixed the error and installed adobe reader and issue was resolved!

    Short URL:
  • Guest - Anitha.veerappa

    Hi All,

    I have a custom xml publisher report already developed which is being run from the SR window. Now the client requirement is to call the same xml publisher from a self service page. The existing code is a PL/SQL code which queries and generates the xml tags for a appraisal_id (Primary key for the whole data) that is passed. Is there a way to reuse the same code, that is create callable statement and execute that procedure to get the xml data. What are the classes that are to be used to get such data from the procedure and convert it to XMLNode in the controller of the page?

    Short URL:
  • Guest - Setu

    Hi,
    Excellent article !!!

    I have an query regarding the above test program. I tried following steps as detailed above and am stuck at Step 5

    Step 5:
    Code = EmpDataDefinition

    Is "EmpDataDefinition" a concurrent program or VO name ? If not a concurrent program where to deploy it and how to register it ?

    My goal to try to use OAF-VO instead of rdf reports for data-model in XMLP. Can this be done ?

    Cheers,
    Setu

    Short URL:
  • Guest - new_member

    Hi Prabhakar Somanathan,
    I am new in OAF. I am trying create OAF to call xml publisher.
    Coudl you send to me all source of steps above.

    Many thanks for your helps

    Short URL:
  • Guest - Dupo

    Hi,
    Is there a way in OA Framework such that when the user clicks a link,a pdf file contaning the output of report or concurrent program should get fired. The pdf file path will be stored in unix and can find out the path from a table.

    Any suggestions....
    Please help me out

    Short URL:
  • Guest - rohit15v

    Hi Prabhakar,

    Even I am getting the same error as some above

    when I try open the PDF file

    could not open because it either not a supported file or because the file has been damaged(for example , it was sent as an email attachement and wasnt correctly decoded

    Please advice it's very urgent.
    if any one got solution plz send me my mail id: rohit15v@yahoo.com

    Short URL:
  • Guest - rohit15v

    please reply.. it's very urgent for me....

    Short URL:
  • Guest - Hieu

    Hi Prabhakar,

    Even I am getting the same error as some above. When I try to open the pdf file "could not open because it either not a supported file oor because file has been damaged..."
    Please advice, it is very urgent. If you have any solution, please send me through email: hieulc_2004@yahoo.com

    Short URL:
  • Guest - Periyasamy Rajamanickam

    A Similar Solution,
    Doc ID: 429990.1 How to Submit a Concurrent Request Using a Self-Service Page

    Short URL:
  • Guest - Periyasamy Rajamanickam

    A Similar Solution, Directly Calling the report from 11i Self Service Menu
    Doc ID: 334847.1
    Subject:How to add a report to a 11i Self Service Menu

    One More Way,
    It seems to Submit Active Users, we can add a button(Create a New Item) to a any page using personalization and call FNDCPPROGRAMPAGE,
    Destination URI: OA.jsp?akRegionCode=FNDCPPROGRAMPAGE&akRegionApplicationId=0&programApplName=FND&programName=FNDSCURS
    Prompt: Active Users Report

    Short URL:
  • Guest - Venkatd

    Hi Prabhakar,

    Thanks for such a nice article. We have followed this and worked on a prototype of a project and everything worked fine. We then enhanced this to actual project, which is based based two queries (master/detail). It is producing two independent xml documents. What we need is root elements which includes these two xml documents. We tried to add two string variables and concatenate them to outputstreams but were unsuccessful (may be due our limited knowledge of the java classes).

    Could you advise what we can do to get desired output? I request Prabhakar, Anil and all Jdeveloper experts in the forum to suggest what we can do and appreciate all your inputs.

    Thanks,
    Venkat

    Short URL:
  • Guest - putchakayala

    Hi ,

    I can able to generate the pdf file from one view object but in my case I have to generate the pdf file from multiple VOs .

    can any one suggest me how to do?

    thanx

    Rama putchakayala

    Short URL:
  • Guest - khalifa

    I am also getting the same error as "not a supported file or file has been damaged".

    when I try open the PDF file

    could not open because it either not a supported file or because the file has been damaged(for example , it was sent as an email attachement and wasnt correctly decoded

    Please advice what to do? or send it to my email

    thx
    khalifa

    Short URL:
  • Guest - khalifa

    my email is h.khalifa@hotmail.com

    Short URL:
  • Guest - khalifa

    hi Prathap

    i did wha you tell me but the i still got "could not open because it either not a supported file or because the file has been damaged " when the PDF file opens

    i really don't know what to do

    thx
    khalifa

    Short URL:
  • Guest - heba

    hii all
    can anyone help me i follow the previos steps and the PDF was generated but when i tried to open it an error message appear " file has been damaged"
    although i have XDO folder in my classes folder

    did anyone solve this problem or it because version of jdeveloper
    my email is eng.heba2006@yahoo.com

    thx
    heba

    Short URL:
  • Guest - khalifa

    hi;
    i want to know if i can use the previous code to generate report based on multipule view objects meaning that the report will be in form of master detail
    or is there any other way to do that ??
    my email is h.khalifa@hotmail.com

    thx
    khalifa

    Short URL:
  • Guest - jyoti jain

    To resolve the problem of multiple vo's you have create your own cutom xml. A sample code is here for your help


    public XMLNode getpayDataXML()
    {
    ByteArrayOutputStream outputStream = new ByteArrayOutputStream();

    ByteArrayOutputStream outputStream1 = new ByteArrayOutputStream();



    MainVOImpl mv = getMainVO1();

    Leave_BalanceVOImpl lb = getLeave_BalanceVO1();



    XMLDocument doc = new XMLDocument();
    Element root = doc.createElement("root");
    Element per= null;
    Element sal= null;
    Element deduction= null;
    Element tpay = null;
    Element tded = null;
    Element total = null;

    Element days_present = null;
    Element leave_balance = null;

    Double paym = 0.0;
    Double ded = 0.0;

    Element dummy = null;


    mv.executeQuery();
    while(mv.hasNext())
    {
    //System.out.println("4");
    per = doc.createElement("PersonRow");
    String ch = "";
    Row p1= mv.next();
    String s[] = p1.getAttributeNames();
    int c = p1.getAttributeCount();
    //System.out.println("Count =" + c);
    for (int i=0;i

    Short URL:
  • Guest - jyoti jain

    for (int i=0;i

    Short URL:
  • Guest - jyoti jain

    sorry freinds I am unable to add the code. Is is not getting updated in the site

    Short URL:
  • Guest - Ambika

    Hi,

    I have an RDF Report which generates the XML data and XML template registered in BI publisher.

    Requirement is to fire the custom existing report instead of standard report.

    The standard controller seems to generate XML and generate OA framework report as shown in your example.

    But I want to extend the existing controller / overwrite the standard to call my custom report.

    Can you tell me how to do this?

    Short URL:
  • Guest - Raj Dutta

    Hi Prabhakar, your article helped me very much to learn how to generate XML data from single VO. Can you please post how to create XML data from multiple VOs.
    Thanks & Regards
    Raj

    Short URL:
  • Guest - Gana

    could not open because it either not a supported file or because the file has been damaged " when the PDF file opens .

    Please guide in this case. Have been sturggling with this error for almost 4 days..

    Short URL:
  • Guest - narne

    Hi

    I need to call a concurrent program using OAF personalization. I got this working fine but I need to know how to pass parameter values to the concurrent program. Please suggest a way to do this.

    Regards,
    Girish.

    Short URL:
  • Guest - Steve

    Thank you for the great sample code. I am able to open, save my pdf file after clicking on a button on page, but the problem is that when I closed the pdf window, my other buttons on the base form do not work, I got a message of "You cannot complete this task because you accessed this page using the browser's navigation buttons (the browser Back button, for example)." Have you seen this kind of error before. Thank you in advance. Steve

    Short URL:
  • Guest - Ashihs Raj

    I assume, You are calling some thing similar to folling statement. params is the Vactor, you can pass all the value as vector. make sure you pass in the same sequence as defiend in CP definiton.

    submitRequest("AP", "APXSOBLX ", "Supplier Open Balance Letter", null, true, params); // arguments vector

    Please check the Comments section og following Blog entery for futher details on the same question.

    Submitting BI Publisher Concurrent Program from PL/SQL

    www.adivaconsulting.com/adiva-blog/item/8-bip_concurrent_program_plsql">http://www.adivaconsulting.com/adiva-blog/item/8-bip_concurrent_program_plsql

    -Raj
    www.adivaconsulting.com

    Short URL:
  • Guest - Ashihs Raj

    Hi Dutta,
    I assume, you want a master detail relationship between VOs. just add thechild VO as View Link and execute the Master VO. When you invoke the master VO to write the xmlNode and write file stream, It will write the xml for all viewlink as well.

    -Raj
    www.adivaconsulting.com

    Short URL:
  • Guest - Robert Jungerius

    The issue that the PDF is not readable, empty or damaged is because you run the page from within JDeveloper.
    I got the same error and in the text that is dumped into the PDF (the PDF contains a complete dump of the error page it seems) i could see that it is because of the file path.
    The file path in JDeveloper is built with windows "\" separator for the folders, while it should be the unix "/" off course.

    After installing the page on the server everything worked fine for me.

    Short URL:
  • Guest - Dracis

    Thanks for the Article, really learning alot. Unfortunately, I (like many others) am getting the issue with the empty/damaged pdf. I am recieving the message both from within Jdeveloper and after deployment to our unix development box. I'm going to keep after it, because this undoubtedly will come in very handy in the future. I'll post back if I have success. If anyone else has figured it out, please post as well. Thanks !!

    Short URL:
  • Guest - Dracis

    OK.. here is how it started working for me. Hopefully, it might help someone else.

    Instead of a PDF.. I set the output for html, so I could read the error message. Their was an error message "No corresponding LOB data.." BLAH BLAH. Come to find out, it could not find my template. Through some trial and error, I set the TEMPLATE_CODE = and the error message went away. Set it back to PDF.. and success... it is working beautifully.

    Not sure why, I'm just a beginner in all this.

    Short URL:
  • Guest - musavi

    HI
    How can i build xdo library from xdo directory on oaf server to my jdeveloper client
    thanks

    Short URL:
  • Guest - Udeshika

    Hi ,

    I am also getting this error

    Error: file type is not supported or file is damaged

    while trying this example.

    Please provide the solution for it,i have gone thorugh the comments above, tried to acchieve,but unable to suceed.

    :(
    Please help!!

    Short URL:
  • Guest - Richa

    Hi

    I am also getting the error as mentioned above. I am working on R12.
    Please suggest something . I am not able to proceed further.

    ~Richa

    Short URL:
  • Guest - MandarD

    Hi

    My requirement is as below

    I have a master page which has a simple search region.
    For eq
    If i query the master page it gives me 5 records
    Clicking on any of the records takes me to the details of that record.
    I have a button which generates the PDF output for that detail record.
    I want the functionality that when the user clicks the button the PDF output should directly be printed

    Currently the user has to open the PDF output and then Click on the Print in PDF output to print the record

    My next requirement is that to bring the PDF button(on the detail Page) to the master page so that on one click i should be able to Print all the PDF report records.

    Please help me with this
    Thanks

    Short URL:
  • Guest - Rolland Charpentier

    Hi
    Do you think it could be possible to bypass the pop up window "File download security Warning"
    and go directly to the PDF file

    Thanks

    Short URL:
  • Guest - srinivasa Telu

    Hi Prabhakar,

    It was a nice a nice article, I have added few properties to make it work.
    Now I have a big issues we have developed this XML report based on a view, but when I modify the view like adding a column or removing a column it is throwing some errors.

    can you please suggest me what to do if VO objects base query that is based on VIEW modified?.

    Thanks in Advance.

    Srinivas

    Short URL:
  • Guest - praveen sudhati

    if u getting the issue with the empty/damaged pdf


    Then create the tmp folder in your local system where jdeveloper is installed.This will fix the issue.

    suppose if ur jdeveloper is present in D drive ,then create the tmp folder in D drive.


    It will fix the error.




    Thanks,
    Praveen Sudhati.

    Short URL:
  • Guest - Hande D

    Application module code :
    public XMLNode[] getDataXML()
    { int r = 0;
    XMLNode NodeList[] = new XMLNode[15];
    try {
    ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
    XxisbtYbnOzlukVOImpl vo = getXxisbtYbnOzlukVO1();
    XxisbtYbnTertayVOImpl tvo = getXxisbtYbnTertayVO1();
    XxisYbnEgitimVOImpl evo = getXxisYbnEgitimVO1();
    XxisHrYbnCezaBilgileriVOImpl cvo = getXxisHrYbnCezaBilgileriVO1();
    XxisbtYbnTumPerformansVOImpl pvo = getXxisbtYbnTumPerformansVO1();
    TesekkurBilgileriVOImpl tevo = getTesekkurBilgileriVO1();
    YakinmaBilgileriVOImpl yvo = getYakinmaBilgileriVO1();
    XxisYbnOdulBilgileriVOImpl ovo = getXxisYbnOdulBilgileriVO1();
    XxisHrHyoToahVOImpl hvo = getXxisHrHyoToahVO1();

    NodeList[0] = (XMLNode)vo.writeXML(4, XMLInterface.XML_OPT_ALL_ROWS);
    ((XMLNode)vo.writeXML(4, XMLInterface.XML_OPT_ALL_ROWS)).print(outputStream);

    if(tvo.first()!=null){
    NodeList[1] = ((XMLNode)tvo.writeXML(4, XMLInterface.XML_OPT_ALL_ROWS));
    ((XMLNode)tvo.writeXML(4, XMLInterface.XML_OPT_ALL_ROWS)).print(outputStream);
    System.out.println(outputStream.toString());
    }
    if(evo.first()!=null){
    NodeList[2] = ((XMLNode)evo.writeXML(4, XMLInterface.XML_OPT_ALL_ROWS));
    ((XMLNode)evo.writeXML(4, XMLInterface.XML_OPT_ALL_ROWS)).print(outputStream);
    }
    if(cvo.first()!=null){
    NodeList[3] = ((XMLNode)cvo.writeXML(4, XMLInterface.XML_OPT_ALL_ROWS));
    ((XMLNode)cvo.writeXML(4, XMLInterface.XML_OPT_ALL_ROWS)).print(outputStream);
    }
    if(pvo.first()!=null){
    NodeList[4] = ((XMLNode)pvo.writeXML(4, XMLInterface.XML_OPT_ALL_ROWS));
    ((XMLNode)pvo.writeXML(4, XMLInterface.XML_OPT_ALL_ROWS)).print(outputStream);
    }
    if(tevo.first()!=null){
    NodeList[5] = ((XMLNode)tevo.writeXML(4, XMLInterface.XML_OPT_ALL_ROWS));
    ((XMLNode)tevo.writeXML(4, XMLInterface.XML_OPT_ALL_ROWS)).print(outputStream);
    }
    if(yvo.first()!=null){
    NodeList[6] = ((XMLNode)yvo.writeXML(4, XMLInterface.XML_OPT_ALL_ROWS));
    ((XMLNode)yvo.writeXML(4, XMLInterface.XML_OPT_ALL_ROWS)).print(outputStream);
    }
    if(ovo.first()!=null){
    NodeList[7] = ((XMLNode)ovo.writeXML(4, XMLInterface.XML_OPT_ALL_ROWS));
    ((XMLNode)ovo.writeXML(4, XMLInterface.XML_OPT_ALL_ROWS)).print(outputStream);
    }
    if(hvo.first()!=null){
    NodeList[8] = ((XMLNode)hvo.writeXML(4, XMLInterface.XML_OPT_ALL_ROWS));
    ((XMLNode)hvo.writeXML(4, XMLInterface.XML_OPT_ALL_ROWS)).print(outputStream);
    }


    }
    catch(Exception e)
    {
    throw new OAException (e.getMessage());
    }
    return NodeList;

    }

    Controller:
    byte buf[] = "".getBytes();
    outputStream.write(buf);

    XMLNode Nodes[] = new XMLNode[10];
    Nodes = AM.getDataXML();

    for(int i = 0;i

    Short URL:
  • Guest - Hande D

    Controller:
    byte buf[] = "".getBytes();
    outputStream.write(buf);

    XMLNode Nodes[] = new XMLNode[10];
    Nodes = AM.getDataXML();

    for(int i = 0;i

    Short URL:
  • Guest - harinireddy

    hi
    can u tell me the code to be written in the co file for go button if the requirement is like if we give the emplno in emp table then d whole details of that empno should be displayed
    for eg if 7369 is typed and go button is pressed then the oputput must show all its details like ename,job,mgr etc
    pzzz do help me

    Short URL:
  • Guest - Anonymous

    I too followed the steps listed on this page and was getting "not a supported file or file has been damaged" while opening the PDF until I read the steps carefully again. The reason for the failure was that I forgot to modify the method getEmpDataXML in AMImpl from "public void getEmpDataXML()" to "public XMLNode getEmpDataXML()" and modify method getEmpDataXML's code to return the xmlNode appropriately. Please refer to author's second version of the method on the page. That was merely a overlook, thinking that I already had the code in the AMImpl's method.

    Anyways, a big thanks to the author to help me learn the integration. Truly appreciate his effort and the site's initiative in making these kind of things available to developers like me.

    Short URL:
  • Guest - swap

    I have a requirement where I have to generate payslips through OFA.

    Payslip report has 3-4 queries in it.

    How to use those 3-4 queries so that I will get XML with groups in it

    Short URL:
  • Guest - donard

    Hi Prabhakar,

    Thanks for the wonderful guide.

    I was able to successfully generate a PDF in my local machine. However, after deploying the changes in our Dev instance, the PDF generated in the Dev instance is corrupted.

    The file size generated in my local is 100KB. In the Dev instance, the file is significantly less, about 65KB only.

    Have you encountered this error?

    Thanks,
    Donard

    Short URL:
  • Guest - michelle01

    Thank you very much for this tutorial - it has been great help in implementing my current program. However, I am experiencing the same problem as Steve above, having spent days (literally!) trying to fix it, but in vain.

    Thank you for the great sample code. I am able to open, save my pdf file after clicking on a button on page, but the problem is that when I closed the pdf window, my other buttons on the base form do not work, I got a message of "You cannot complete this task because you accessed this page using the browser's navigation buttons (the browser Back button, for example)." Have you seen this kind of error before. Thank you in advance.


    Does anyone know a solution to this problem?

    Short URL:
  • Guest - Narender

    Hi Prabhakar,

    Thank you so much for the great tutorial. But I have a wierd requirement. I would be really thankfull if you can provide some inputs.
    When the button is clicked on the self service page, the PDF has to go to the printer without previewing it. Is there anyway to achieve this? PLEASE HELP...

    Thanks,
    Narender

    Short URL:
  • Guest - Ganesh Golla

    Hi All,

    can anyone help me, i followed the previous steps and the PDF was generated but when i tried to open it an
    error message as below
    "Adobe Reader could not open because it either not a supported file or because the file has been damaged(for example , it was sent as an email attachment and wasn't correctly decoded"

    even i have XDO folder in my classes folder
    Did anyone solve this problem, Please advice what to do?
    or send it to my email ganeshg.lerp@gmail.com

    Short URL:
  • Guest - KULASEKHAR

    XMLNode xmlnode = (XMLNode)headervoimpl.writeXML(6, 0L);
    XMLNode xmlnode1 = null;
    XMLNode xmlnode2 = null;
    if(!isNull(as[2]) && "Y".equalsIgnoreCase(as[2]))
    {
    HeaderTemplateVOImpl headertemplatevoimpl = getHeaderTemplateVO();
    headertemplatevoimpl.setWhereClauseParam(0, as[8]);
    headertemplatevoimpl.executeQuery();
    headertemplatevoimpl;
    xmlnode1 = (XMLNode)headertemplatevoimpl.writeXML(3, 0L);
    }

    The above code

    XMLNode xmlnode = (XMLNode)headervoimpl.writeXML(6, 0L);

    xmlnode1 = (XMLNode)headertemplatevoimpl.writeXML(3, 0L);

    WriteXML(6,0L) and writeXML(3, 0L) What are why those are using icant understand that thngs and

    6, 0L what is the meaning of those thimgs.

    please help me

    Short URL:
  • Guest - KumarKK

    Hello,

    I want to display the output using different html tags to beautify the output in pdf. Your demo works great but when my data contains the html tags inside the xml template, it's only displaying the tags directly instead of displaying the formatted data.

    Any suggestions on how to deal with this?

    Thank You
    Raj

    Short URL:
  • Thanks For Your Information and Any body wants <br /><br />learn Oracle OAF through Online for Details Please go through the Link<br /><br /> <br />Oracle OAF Online Training with free demo in INDIA | GERMANY | USA | UK <br /><br />This Will Helps you aalot.

    Short URL:
  • Hi Prabhakar,<br /><br />We are unable to view the images in your articles.<br />Please share images.<br />Thank you.

    Short URL:
  • Guest - smile_t

    Hi everybody,<br /><br />İ am getting this error "xml-20108 (fatal error) start of root element expected" Is it version problem or bug? please help me

    Short URL:

Search Trainings

Fully verifiable testimonials

Apps2Fusion - Event List

<<  Jun 2016  >>
 Mon  Tue  Wed  Thu  Fri  Sat  Sun 
    1  2  3
   

Enquire For Training

Related Items