Question : Oracle forms 10g

Dear Expert,
    Iam working on oracle 10g forms.
    I have a button in my form,and i have to pass data from oracle table  to xls.
   Please send me the code..

Answer : Oracle forms 10g

You can create csv file which can open into Excel worksheet. Assume you have emp block and has empno and ename columns

Do you want to pass data from the forms block or from the cursor
From Forms Block :
Write trigger WHEN-BUTTON-PRESSED

GO_BLOCK('EMP');
text_io.fopen('EMPDATA.CSV', 'W');
FIRST_RECORD;
LOOP
  Text_IO.Put('EMPDATA.CSV',:emp.empno);
  Text_IO.Put('EMPDATA.CSV',:emp.ename);
   NEXT_RECORD;
  IF :SYSTEM.LAST_RECORD = 'TRUE' THEN
     EXIT;
 END IF;
END LOOP;
text_io.fclose('EMPDATA.CSV');

This will create csv file on your middle tier. As you not specified where you want to create file. This is easiest solution.  You can use utl_file to create on database server . If you want to create file on client side, Oracle provided code to do it on client side using OLE on the client using WebUtil.
http://www.oracle.com/technetwork/developer-tools/forms/howto-ole-090332.html
This will explain you one column example, but you can add it as per your requirement.

Hope this will help.



Random Solutions  
 
programming4us programming4us