Home » Developer & Programmer » Reports & Discoverer » Reports to csv (Oracle Reports 6i)
Reports to csv [message #591265] Fri, 26 July 2013 01:52 Go to next message
kolpalamayaw
Messages: 7
Registered: May 2013
Location: TURKEY
Junior Member
Hi all,

I have a questions about oracle reports. I created the data model as Q_1,Q_2,Q_3
Q_1 like this: select c_name,c_phone from customer
Q_2 like this: select c_polid,c_pid from police
Q_3 like this: select c_bank,c_accountno from bank

I would like to write this report to .csv I created procedure like this:
-------------------
PROCEDURE Print2File (p_str in varchar2, p_tip in varchar2) IS
fp text_io.file_type;
begin
fp := text_io.fopen('x:\Holdingsigortalirap1.csv', p_tip);
text_io.putf(fp, p_str || '\n');
text_io.fclose(fp);
end;
--------------------

And I added to formula column in Q_1,Q_2 and Q_3 like this:

Q_1:

function DOSYAYAYAZFormula return Number is
begin
Print2File (:c_name|| ';' || :c_phone , 'A');

RETURN(0);
end;
----------------
But when I write like this .csv file show:
first row: c_name,c_phone
second row: c_polid,c_pid
third row: c_bank,c_accountno

Actually, I want to all column in first row like this:
first row: c_name,c_phone,c_polid,c_pid, c_bank,c_accountno
------------------

how can I do like this?

Best Regards,




Re: Reports to csv [message #591268 is a reply to message #591265] Fri, 26 July 2013 02:03 Go to previous messageGo to next message
Littlefoot
Messages: 19630
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Why don't you, instead, create a report in CHARACTER mode?
Re: Reports to csv [message #591284 is a reply to message #591268] Fri, 26 July 2013 02:51 Go to previous messageGo to next message
kolpalamayaw
Messages: 7
Registered: May 2013
Location: TURKEY
Junior Member
Actually, this report was already created by DBA. I dont want to change it. I would like to create .csv file which has report's data.
Re: Reports to csv [message #591355 is a reply to message #591284] Fri, 26 July 2013 11:44 Go to previous message
stalin4d
Messages: 214
Registered: May 2010
Location: Chennai, Tamil Nadu, Indi...
Senior Member
kolpalamayaw wrote on Fri, 26 July 2013 13:21
Actually, this report was already c reated by DBA. I dont want to change it. I would like to create .csv file which has report's data.


I too has the same query, I have already a Report which is created via Oracle Reports 6i, well i need to generate this oracle report data into a excel or csv format, directly when clicking the report button, not through generate to file option.

Regards,
Stalin
Previous Topic: frm-41214 : Unable to run report
Next Topic: print image on criteria
Goto Forum:
  


Current Time: Sat Sep 20 21:35:47 CDT 2014

Total time taken to generate the page: 0.54235 seconds