forms to excel data transfer [message #450725] |
Thu, 08 April 2010 23:43 |
shaz
Messages: 182 Registered: June 2009
|
Senior Member |
|
|
Hello Everyone,
I found another way to transfer the data from forms to excel apart from doing it through ole2 or client. So thought of sharing it with all...
Here it goes:-
declare
ifile client_text_io.file_type;
temp varchar2(1000);
Cursor c1 is select ename, job from emp;
BEGIN
ifile := client_text_io.fopen(ltrim(rtrim('C:\test.xls')),'w');
-- Header creation
client_text_io.put_line(ifile,'Employee Num'||chr(9)||'Job');
for i in c1 loop
temp:=i.ename||chr(9)|| i.job;
client_text_io.put_line(ifile,temp);
end loop;
client_text_io.FCLOSE(IFILE);
End;
Attach webutil to form and just paste the code on a button and log on to scott. The excel file will be created in c: drive with name test.
|
|
|
Re: forms to excel data transfer [message #450729 is a reply to message #450725] |
Fri, 09 April 2010 00:08 |
|
Littlefoot
Messages: 21818 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
Quote:The excel file will be created in c: drive with name test.
No, it will not.
File name will be TEST.XLS, but extension is all that it shares with Excel. The result within the file will be TAB separated values. True, Excel is capable of opening it, but this is not an Excel file.
[Updated on: Fri, 09 April 2010 00:08] Report message to a moderator
|
|
|
Re: forms to excel data transfer [message #450733 is a reply to message #450729] |
Fri, 09 April 2010 00:25 |
shaz
Messages: 182 Registered: June 2009
|
Senior Member |
|
|
Hi Littlefoot,
Glad to hear from you.
Quote:this is not an Excel file.
How can you say that? If its not excel file then which file is it? Please justify.
I had to create a file in excel, which is used by other team in there program created not in oracle. They discard the file provided in txt or csv file format.
Earlier I had created the xls using client_ole and it was working fine. A week back, the requirement got changed and i had to do some changes. I changed the logic and created the file using the procedure stated above. It is accepted by them and is running fine.
[Updated on: Fri, 09 April 2010 00:34] Report message to a moderator
|
|
|
|
|
|