how to print text in center while generating .csv file using oracle forms [message #631210] |
Sat, 10 January 2015 06:26 |
|
jgjeetu
Messages: 373 Registered: July 2013 Location: www.Orafaq.com/Forum
|
Senior Member |
|
|
PROCEDURE GEN_EXCEL IS
IN_FILE TEXT_IO.FILE_TYPE;
VC_HEAD Varchar2(32000);
BEGIN
IN_FILE := TEXT_IO.FOPEN('C:\'||'123.CSV','W');
TEXT_IO.PUT_LINE(IN_FILE,'EMPLOYEE DETAILS'||chr(10));
VC_HEAD := 'EMPNO,ENAME,JOB,MGR,SAL,COMM,DEPTNO';
TEXT_IO.PUT_LINE(IN_FILE,VC_HEAD);
FOR C1 IN ( SELECT EMPNO,ENAME,JOB,MGR,SAL,COMM,DEPTNO FROM EMP) LOOP
TEXT_IO.PUT_LINE(IN_FILE,C1.EMPNO||','||C1.ENAME||','||C1.JOB||','||C1.MGR||','||C1.SAL||','||C1.COMM||','||C1.DEPTNO);
END LOOP;
TEXT_IO.FCLOSE(IN_FILE);
MESSAGE('Excel file has been created!');
MESSAGE('Excel file has been created!');
EXCEPTION
WHEN NO_DATA_FOUND THEN
TEXT_IO.FCLOSE(IN_FILE);
MESSAGE('Error while writing file');
MESSAGE('Error while writing file');
END;
I have made this procedure to print query output in .csv format so that i could open it using excel.
i created this procedure in program units in forms and used procedure name on push button .
and when i presson it gives me output :-
now my requirement is i want to print employee details header in center of .csv file.
TEXT_IO.PUT_LINE(IN_FILE,'EMPLOYEE DETAILS'||chr(10));
please tell me how to achieve this.
-
Attachment: emp.JPG
(Size: 47.60KB, Downloaded 2430 times)
|
|
|
|
|
|
|
|
|
|