Home » Developer & Programmer » Forms » Data Export to Excel file (Oracle 9i, Forms 6i)
Data Export to Excel file [message #413039] Tue, 14 July 2009 01:41 Go to next message
ab_trivedi
Messages: 460
Registered: August 2006
Location: Pune, India
Senior Member
Dear All,
i want to add one button in the form like "save as" and save the displayed data into excel file.
Any one please suggest how to proceed.
Bye
Ashu
Re: Data Export to Excel file [message #413105 is a reply to message #413039] Tue, 14 July 2009 06:56 Go to previous messageGo to next message
ab_trivedi
Messages: 460
Registered: August 2006
Location: Pune, India
Senior Member
Dear All,

I am able to made a form which exports data from form to excel.
Bye
Re: Data Export to Excel file [message #413113 is a reply to message #413039] Tue, 14 July 2009 07:24 Go to previous messageGo to next message
blaxmi
Messages: 36
Registered: May 2008
Location: Hyderabad
Member
hi

you can use rp2xls.run procedure in the report.
call the report from the form and in the form it will open .pdf report.

use one button in the report to save the data in the excel sheet.

bye
Re: Data Export to Excel file [message #413456 is a reply to message #413113] Wed, 15 July 2009 18:22 Go to previous messageGo to next message
lacchhii
Messages: 151
Registered: May 2009
Location: bangalore
Senior Member

you can use rp2xls.run procedure in the report.

hi,laxmi,

could you pl tell me how to write the rp2xls.run procedure in report. I am also trying to export to excel.

thanks in advance

lacchhii
Re: Data Export to Excel file [message #413468 is a reply to message #413456] Wed, 15 July 2009 21:40 Go to previous messageGo to next message
ab_trivedi
Messages: 460
Registered: August 2006
Location: Pune, India
Senior Member
Hi Narayan,

you can customized my form according toy yuor needs. change the block name, filed name and test procedure.

AT
Re: Data Export to Excel file [message #413472 is a reply to message #413039] Wed, 15 July 2009 23:13 Go to previous messageGo to next message
blaxmi
Messages: 36
Registered: May 2008
Location: Hyderabad
Member
Hi,

Use this code in the button called "formtoexcel" in your .fmb

declare
ReptName Varchar2(100) ;

BEGIN

ReptName := 'D:\Desktop items\laxmi\Internal Projects\dvdnd_curr\un_paid_folio_no.rdf';
Run_Product(REPORTS, ReptName, Synchronous, Runtime, Filesystem, pl_id, Null) ;


END;


Then the report will opened in the pdf format.
In the report u just place one text field out of all the frames and in PL/SQL editor write the code as below:

RPT2XLS.put_cell(1, 'heading1', FontColor => 11, FontSize => 12);
RPT2XLS.put_cell(2, 'heading2', FontColor => 11, FontSize => 12);
RPT2XLS.put_cell(3, 'heading3', FontColor => 11, FontSize => 12);
RPT2XLS.new_line;

In the report Layout model press edit margin in the tools provided. Place one button and name that accordingly. In the pl/sql editor write rpt2xls.run then compile the report.

Run the report from the form pdf file will be opened then press the button in the report then it will be transformed into excel.

Re: Data Export to Excel file [message #413645 is a reply to message #413472] Thu, 16 July 2009 22:39 Go to previous messageGo to next message
lacchhii
Messages: 151
Registered: May 2009
Location: bangalore
Senior Member

hi laxmi,

thanks for the code. I did try using the code in one of my FMB AND RDF FILE as per your instruction.

I created a button in FMB and used this code and it gives the report

declare
ReptName Varchar2(100) ;

BEGIN

ReptName := 'D:\Desktop items\laxmi\Internal Projects\dvdnd_curr\un_paid_folio_no.rdf';
Run_Product(REPORTS, ReptName, Synchronous, Runtime, Filesystem, pl_id, Null) ;
END;


when i use this code in rdf file it gives an compilation error
identifier not found.

RPT2XLS.put_cell(1, 'heading1', FontColor => 11, FontSize => 12);
RPT2XLS.put_cell(2, 'heading2', FontColor => 11, FontSize => 12);
RPT2XLS.put_cell(3, 'heading3', FontColor => 11, FontSize => 12);
RPT2XLS.new_line;

and even the rpt2xls.run also is not being accepted.

I have attached the fmb and rdf file with the codes entered. It would be great if u could make the necessary corrections and send it.

thanks in advance

lacchhii
  • Attachment: Kfa_07.RDF
    (Size: 184.00KB, Downloaded 2099 times)
Re: Data Export to Excel file [message #413646 is a reply to message #413645] Thu, 16 July 2009 22:40 Go to previous messageGo to next message
lacchhii
Messages: 151
Registered: May 2009
Location: bangalore
Senior Member

hi,
here is the fmb file also being attached

lacchhii
  • Attachment: KFA_07.FMB
    (Size: 96.00KB, Downloaded 2626 times)
Re: Data Export to Excel file [message #413660 is a reply to message #413039] Thu, 16 July 2009 23:46 Go to previous messageGo to next message
blaxmi
Messages: 36
Registered: May 2008
Location: Hyderabad
Member
hi,

i have made some of the changes in your report and no changes in your form(.fmb). compile the report first then see weather the code is working properly or not. i'm sure it will definately work. here i'm attaching the updated .rdf file and rename it accordingly.

bye
  • Attachment: Kfa_07.RDF
    (Size: 196.00KB, Downloaded 2016 times)
Re: Data Export to Excel file [message #413917 is a reply to message #413660] Sat, 18 July 2009 20:58 Go to previous messageGo to next message
lacchhii
Messages: 151
Registered: May 2009
Location: bangalore
Senior Member

hi,

thanks for the corrections made in the rdf file. even after the changes it throws a compilation error.

I have attached a screen shot of the error message for your perusal.

one more thing i am using reports 6i and oracle 8i. Is the error because of this.

thanks for your help in advance
  • Attachment: RP2XLS.pdf
    (Size: 57.37KB, Downloaded 3427 times)
Re: Data Export to Excel file [message #413969 is a reply to message #413039] Sun, 19 July 2009 22:52 Go to previous messageGo to next message
blaxmi
Messages: 36
Registered: May 2008
Location: Hyderabad
Member
hi,

i could not open the pdf document that attached. save the screen shot in the word file and attach it again.

in google search the solution for the error message that you are getting.

anyway send the screen shot to me so that i will try to solve your problem.


bye
Re: Data Export to Excel file [message #413997 is a reply to message #413969] Mon, 20 July 2009 01:25 Go to previous messageGo to next message
lacchhii
Messages: 151
Registered: May 2009
Location: bangalore
Senior Member

hi,

the word doc is not allowed to be attached. thats why i attached a pdf . I am attaching a jpg file . see if you can open it. or else if you can give me your email id , i can send it to your email id.

narayan
  • Attachment: RP2XLS.jpg
    (Size: 102.89KB, Downloaded 1951 times)
Re: Data Export to Excel file [message #414006 is a reply to message #413039] Mon, 20 July 2009 02:00 Go to previous messageGo to next message
blaxmi
Messages: 36
Registered: May 2008
Location: Hyderabad
Member
Hi,

I have seen your attached jpg file. i could understand your problem. you have created a format trigger at object level.

That is if you observe your screen shot with my screen shot attached you will find the difference in the type, object and boilerplate text name. Ok if u still have any doubts attach your report and send it to me.

now update the report i'm sure definately it will work.
  • Attachment: Doc1.pdf
    (Size: 250.05KB, Downloaded 3056 times)
Re: Data Export to Excel file [message #414200 is a reply to message #414006] Mon, 20 July 2009 23:08 Go to previous messageGo to next message
lacchhii
Messages: 151
Registered: May 2009
Location: bangalore
Senior Member

hi,

sorry to bother you again. I did try to use the code in layout boilerplate in a text box as shown in your screenshot, but the error still persits.

I have attached the screenshot again alongwith your screen shot file for your reference.

the report is already attached in the name kfa_07 in this thread.

kindly let me know where i am going wrong.

narayan
  • Attachment: RP2XLS.pdf
    (Size: 315.53KB, Downloaded 2735 times)
Re: Data Export to Excel file [message #414205 is a reply to message #413039] Mon, 20 July 2009 23:42 Go to previous messageGo to next message
blaxmi
Messages: 36
Registered: May 2008
Location: Hyderabad
Member
Hi,

Instead of modifying your report here i'm attaching my report file for your perusal.

I hope you can understand the problem in your report when you see my report.
Re: Data Export to Excel file [message #414651 is a reply to message #413039] Thu, 23 July 2009 01:55 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Have you considered using 'text_io'?

David
Re: Data Export to Excel file [message #414654 is a reply to message #413039] Thu, 23 July 2009 02:00 Go to previous messageGo to next message
blaxmi
Messages: 36
Registered: May 2008
Location: Hyderabad
Member
I could not understand what exactly you are asking about?
Re: Data Export to Excel file [message #414772 is a reply to message #414654] Thu, 23 July 2009 07:45 Go to previous messageGo to next message
lacchhii
Messages: 151
Registered: May 2009
Location: bangalore
Senior Member

hi,

thanks a lot for your help. I did try as per your report. the mistake i had done was i had not created a package body and once i copied the code in the package body the report was compiled without errors and i got the report output.

But i couldn't locate the excel file of the same report. Do i have to specify any path in the report or will it be there in any default path?

narayan
Re: Data Export to Excel file [message #414884 is a reply to message #414654] Thu, 23 July 2009 23:28 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
@B.Laxmi,

You can use 'text_io' to write your data to a 'csv' file. Each field is separated from the previous by a comma.

You then open the file with a spreadsheet processor. Much simpler than going through all the other stuff.

David
[EDITED by DJM: fix typos]

[Updated on: Thu, 17 September 2009 20:39]

Report message to a moderator

Re: Data Export to Excel file [message #418532 is a reply to message #413039] Mon, 17 August 2009 01:39 Go to previous messageGo to next message
becklery
Messages: 8
Registered: April 2009
Junior Member
Hi, ab_trivedi.
I think you can use RAQ Report. First, you need to make a web report with it, and it is very easy. Second, you can input your desired data. Third, you can export the report to an Excel file with only a click. Is it very easy?
Re: Data Export to Excel file [message #553696 is a reply to message #413472] Tue, 08 May 2012 01:04 Go to previous message
jolieassaad
Messages: 18
Registered: May 2012
Location: Lebanon
Junior Member
Hi , I used this code and it works but I have one problem . I have duplicate data that are not duplicate in the report.
Could you please help me?

Regards,
Previous Topic: call report using RUN_PRODUCT on Forms 6i and 11g
Next Topic: Parameter for get read receipt/delivery send mail from OutlookApp OLE2.OBJ_TYPE
Goto Forum:
  


Current Time: Fri Jul 05 21:25:17 CDT 2024