Wednesday, 12 November 2014

Export Data From OAF Table in Excel

Export Data From OAF Table in Excel

1. Below steps needs to be done on J developer.


  • Right Click on Table --> New --> Table Actions --> 

            
2. In the new Default Flow Region inside Table Actions, create a new item and select the item Style as export Button.

  • Table Actions Region




  • Item Properties


  • Save the Changes and Run the Page. The Output table Should look something like the below Screen.

3. Once user Clicks on Export button all the data in the table will be extracted a a text file. To Download Data as an Excel friendly format we need to set one Profile Option "FND_EXPORT_MIME_TYPE".

To set the profile from PLSQL use the below code:

DECLARE
   a   BOOLEAN;
BEGIN
   a := fnd_profile.SAVE ('FND_EXPORT_MIME_TYPE'
                        , 'application/excel'
                        , 'SITE'
                        , NULL
                        , NULL
                        , NULL
                         );

   IF a
   THEN
      DBMS_OUTPUT.put_line ('Success');
      COMMIT;
   ELSE
      DBMS_OUTPUT.put_line ('Error');
   END IF;
END;








3 comments:

  1. Hi Ankur,

    Thanks for this post. I am having the same requirement, i followed the steps you mentioned.
    But, when i click the export button, i am getting error stack :
    JBO-27122: SQL error during statement preparation. Statement: SELECT XXYHCustReservationEO.ACCOUNT_NAME,
    java.sql.SQLException: Invalid column type
    ...............................

    So for this error, google says, change the VO bind type from Named to Positional and try, but when i did it, other custom code started showing error.

    What would you suggest, should i check and try to fix code errors aroused due to change VO bind method or change the approach of Export from your method to programatic approach.

    Your response is greatly appreciated.

    Thanks

    ReplyDelete
  2. Hi Pavan,

    Please Set Export Button Property "Export All Rows" as false.

    ReplyDelete
  3. Please select view name in viewInstance property of the item.

    ReplyDelete