Showing posts with label Export Data From OAF Table in Excel. Show all posts
Showing posts with label Export Data From OAF Table in Excel. Show all posts

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;