Apps To Fusion

.......Our Journey from Apps To Fusion

 
  • Increase font size
  • Default font size
  • Decrease font size



Oa Framework - Xml Publisher Integration for R12

E-mail
User Rating: / 42
PoorBest 
Business Requirement : When User  require report output from jsp/Oa framework  page    then They have to Run concurrent program  which is very tedious process for users and if user wants output in Excel/PDF/Word and in many  other formats then they have to run concurrent program again and again  for each different type of output file.

So Business requirement is that report output should be retrieved from  Oa framework Page Just by single Button Click For Different Type Of Formats.






Sample Output :-


Solution : Creating Oa framework Report and Showing output of Report in Different Format We have to integrate oa framework and Xml Publisher.

For this solution first you have to create Oa framework page, Data Template and Data definition.

STEPS:-
  1. Open Jdeveloper and create new project “oareport”.
 

 
  1. Create view object using below query.
Field
Value
Package
oareport.oracle.apps.ak.server
Name
EmpVO

Query:
 
select employee_number,full_name,hr_general.decode_lookup('SEX',sex)sex,hr_general.decode_lookup('NATIONALITY',nationality)nationality from per_all_people_f
where trunc(sysdate) between effective_start_date and effective_end_date
and current_employee_flag='Y'
and rownum =1

  1. Create Application Module.
Field
Value
Package
oareport.oracle.apps.ak.server
Name
XMLIntegrationAM
 
  1. Click on Edit Application module on “XMLIntegrationAM” and move “EmpVO”  to right side.

 
  1. Right Click on Project and Create new oa component -> Page.
Field
Value
Package
oareport.oracle.apps.ak.webui
Name
XMLIntegrationPG




 
  1. go to Structure of page -> Page Layout region  and set Below Property      
Field
Value
ID
MainRN
AM Definations
oareport.oracle.apps.ak.server.XMLIntegrationAM
Window Title
Welcome Page

  1. Right Click on MainRN and click on Set new Controller Class.
Field
Value
Package Name
oareport.oracle.apps.ak.webui
Class
XMLIntegrationCO


  1. Go to Controller and Add below code in processRequest of XMLIntegrationCO.java

 
 
 public void processRequest(OAPageContext pageContext, OAWebBean webBean)
 {
   super.processRequest(pageContext, webBean);
   OAApplicationModule am= pageContext.getApplicationModule(webBean);
   am.invokeMethod("getEmpDataXML");

 }
 
  1. Go to structure of Application module XMLIntegrationAM and open XMLIntegrationAMImpl.java  file and add below method in File.
 
   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() + "Custom Error");
   }
 }
 
  1. Right Click on XMLIntegrationPG and click on Run.
After completing  loding of page Compiler Will Display below Output.




Save above xml content to file.

Xml File Name: EmpData.xml
 
<EmpVO>
  <EmpVORow>
     <EmployeeNumber>4</EmployeeNumber>
     <FullName>Walker, Mr. Kenneth (Ken)</FullName>
     <Sex>Male</Sex>
     <Nationality>American</Nationality>
  </EmpVORow>
</EmpVO>
 
  1. Go to structure of  XMLIntegrationPG and add pageButtonBar region .
Field
Value
ID
ButtonRN
Region Style
pageButtonBar


  1. Right Click on ButtonRN and add 3 new items with below property.
1)
Field
Value
ID
PrintWord
Item Style
SubmitButton
Prompt
Print  Word

2)
Field
Value
ID
PrintExcel
Item Style
SubmitButton
Prompt
Print Excel

3)
FieldValue
ID PrintPdf
Item Style SubmitButton
Prompt Print PDF


  1. Right Click on MainRN in XMLIntegrationPG and add below new QueryRegion.
Field
Value
ID
QueryRN
Region Style
query
Construction
resultBasedSearch
Include Simple panel
true
 
  1. Right Click on QueryRN and click Region using wizard and add new table region and add EmpVO in table.
  1. Go to XMLIntegrationAM and change code of below method.
 public XMLNode getEmpDataXML()
 {
   try
   {

     OAViewObject vo = (OAViewObject)findViewObject("EmpVO1");
     XMLNode xmlNode = (XMLNode)vo.writeXML(4, XMLInterface.XML_OPT_ALL_ROWS);
     return xmlNode;
   } catch (Exception e)
   {
     throw new OAException(e.getMessage() + "Custom Error");
   }
 }


  1. Change controller class XMLIntegrationCO.java according to below Attached file.
  1. Retrive $JAVA_TOP/oracle/apps/xdo Directory from server and place it in Jdeveloper because it is needed for some import.
  1. Build Project and run XMLIntegrationPG but it will show blank output in output file  on Clint machine but when you Deploy it to server and take output then it will show correct output.
  1. create "oareport" directory on desktop from merging code of  “myproject” and “my classes”.
    Source Code : oareport.rar
  1. Move  "oareport"  to $JAVA_TOP Directory.
  1. Run below script to import oa framework page
     
java oracle.jrad.tools.xml.importer.XMLImporter $JAVA_TOP/oareport/oracle/apps/ak/webui/XMLIntegrationPG.xml -username APPS -password apps -dbconnection " (DESCRIPTION= (ADDRESS=(PROTOCOL=tcp) (HOST=192.168.1.200)(PORT=1521)) (CONNECT_DATA= (SID=vis) ) )" -rootdir $JAVA_TOP
  1. Restart Server.

adoacorectl.sh stop
adoacorectl.sh start

adapcctl.sh stop
adapcctl.sh start
  1. Create Data Definition.
Field
Value
Name
EmpDataDD
Application
Human Resources
Code
EmpDataDD
Start Date
Current Date

  1. create Data Template
Name
EmpDataDT
Application
Human Resources
Type
RTF
Default File
EmpData.rtf
Default File Language
English
Code
EmpDataDT
Data Definition
EmpDataDD
Start Date
Current date
End Date
 
Sub template
No
Default File Territory
 
Default Output Type
PDF
Preview Format
PDF
File Name
EmpData.rtf
Language
English
RTF File
XML File


  1. create below form function.
Field
Value
Function
XX_EMPLOYEE_DETAILS_PAGE
User Function Name
XX_EMPLOYEE_DETAILS_PAGE
Type
SSWA jsp function
HTML Call
OA.jsp?page=/oareport/oracle/apps/ak/webui/XMLIntegrationPG




  1. Attach  function To below menu.
Field
Value
Function Name
XX_EMPLOYEE_DETAILS_PAGE
User Menu Name
Employee Detail Menu
Menu Name
XX_EMPLOYEE_DETAILS_MENU


  1. Create below Responsibility and attach Below Menu.
Field
Value
Responsibility Name
Employee detail Responsibility
Responsibility Key
XX_EMPLOYEE_DETAIL_RESP
Menu name
Employee Detail Menu


  1. Attach Responsibility  to your user.

  1. Login  to Your User  and open page.

  1. Click on Print Pdf .
  1. Click on open It Will show Output in Pdf format.

  1. Click on Print Word .


  1. Click on open output will be shown in word format.

  1. Search any employee number and click on print Excel.
  1. Click on open output will show record for one Employee.
Comments (11)add
Thanks
written by Shruti Khanna , October 30, 2011
Thanks for the detailed steps, very useful, Shruti
report abuse
vote down
vote up
Votes: +1
Thank you much for this
written by RKNewOAGuy , October 30, 2011
Very detailed. Thanks much for that info.
report abuse
vote down
vote up
Votes: +0
Cool..
written by AppAttack , October 31, 2011
Thanks for this tutrial...very helpful!
report abuse
vote down
vote up
Votes: +0
Nice one
written by AppsTechSpider , October 31, 2011
Thanks, I can see this being used in almost every project. Carlo
report abuse
vote down
vote up
Votes: +0
SUPERB!!!!
written by smith , November 01, 2011
Absolutely awesome Info very very usefull.
Thanks a lot for ur efforts.
report abuse
vote down
vote up
Votes: +0
Nice One!
written by Khalid Mehmood , November 25, 2011
Thanks Dakshesh, Its really a good effort. Thanks a lot.
report abuse
vote down
vote up
Votes: +0
Excellent!
written by Rahul S , November 29, 2011
Superb article! Thanks for the detailed steps.

report abuse
vote down
vote up
Votes: +0
missing file
written by smith , November 30, 2011
Hi Dakshesh,
Thanks a lot for sharing this article,absolutely awesome.
But am getting an error while opening the report from application (after the page is completely developed from jDeveloper and have moved
everything to midtear).
the error is when i press one of the options like say PrintWord, am getting error " missing file .. cabostylescacheswanEXTN-custom-2 3 6 2-en-ie-windows.css"
Don't have any clue about this.
Any suggestions in this regard is highly appreciated.
Thanks

report abuse
vote down
vote up
Votes: +0
Oracle Apps Consultant
written by SyedLaiq , December 17, 2011
Dear,

I cannot run the page due to following error "Error(26,smilies/cool.gif: class XML Node", please provide me the import for this class.

Regards,

Syed Laiq Uddin
report abuse
vote down
vote up
Votes: +0
Very Useful Functionality !
written by Abdulrahman , December 21, 2011
Hi Daksesh,
keep up the good work Daksesh, hope to see more of your great work again soon.
warm regards
Abdulrahman
report abuse
vote down
vote up
Votes: +0
After deployment getting error
written by Hassan Shoaib , December 22, 2011
Hi,

After deployment of the code on R12.0.6 I am getting the following error: Can you please advise about the missing class?

An exception occured.

URL=http://xxxx.xxxx.com:8000/OA_HTML/OA.jsp?page=/oareport/oracle/apps/ak/webui/XMLIntegrationPG&transactionid=1010681421&language_code=US&CallFromForm='Y'

javax.servlet.ServletException: oracle.classloader.util.AnnotatedClassNotFoundException:

Missing class: __9__9_OA

Dependent class: oracle.jsp.runtimev2.JspPageInfo
Loader: oc4j:10.1.3
Code-Source: /d01/ebsr12/apps/tech_st/10.1.3/j2ee/home/lib/ojsp.jar
Configuration: in META-INF/boot.xml in /d01/ebsr12/apps/tech_st/10.1.3/j2ee/home/oc4j.jar

This load was initiated at oacore.web.html.jsp990395144:0.0.0 using the loadClass() method.

The missing class is not available from any code-source or loader in the system.



report abuse
vote down
vote up
Votes: +1
Write comment
quote
bold
italicize
underline
strike
url
image
quote
quote
smile
wink
laugh
grin
angry
sad
shocked
cool
tongue
kiss
cry
smaller | bigger

security image
Write the displayed characters


busy
Last Updated ( Sunday, 30 October 2011 11:12 )  

Related Items

Search apps2fusion