Skip to Main Content

Oracle Forms

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to select to which Excel sheet to write data from oracle forms? (using DDE package commands)

VukMNEMar 21 2018 — edited Mar 23 2018

Hello everyone,

I am using Oracle Forms 6i (I know that it is outdated, but I can't change it, and I am trying to write some data from the Oracle database into the Excel document. This is not the first time I am doing it.

However, there is one thing that is new - I need to write data to different sheets in Excel.

I have tried two different methods.

Method 1:

v_row_number := 4; /* Start writng from the 4th line in Excel document*/

v_column_number := 2; /* Start writng from the 2nd line in Excel document*/

DDE.EXECUTE(convid,'[activate(~"Sheet1"~)]',10000);

/* I do not know if I used DDE.EXECUTE in a right way, or I completely made it up.

I saw something similar here: https://documentation.progress.com/output/ua/OpenEdge_latest/index.html#page/dvpin/dde-example.html */

for row in cursor loop 

DDE.POKE(DOCID, 'R'||v_row_number||'C'||v_column_number, row.val1, DDE.CF_TEXT, 10000);

DDE.POKE(DOCID, 'R'||v_row_number||'C'||(v_column_number+1),row.val2, DDE.CF_TEXT, 10000);

DDE.POKE(DOCID, 'R'||v_row_number||'C'||(v_column_number+2),row.val2, DDE.CF_TEXT, 10000);

DDE.POKE(DOCID, 'R'||v_row_number||'C'||(v_column_number+3),row.val2, DDE.CF_TEXT, 10000);

v_row_number:= v_row_number + 1;

end loop;

Method 2:

for row in cursor loop 

DDE.POKE(DOCID, 'Sheet1!R'||v_row_number||'C'||v_column_number, row.val1, DDE.CF_TEXT, 10000);

DDE.POKE(DOCID, 'Sheet1!R'||v_row_number||'C'||(v_column_number+1),row.val2, DDE.CF_TEXT, 10000);

DDE.POKE(DOCID, 'Sheet1!R'||v_row_number||'C'||(v_column_number+2),row.val2, DDE.CF_TEXT, 10000);

DDE.POKE(DOCID, 'Sheet1!R'||v_row_number||'C'||(v_column_number+3),row.val2, DDE.CF_TEXT, 10000);

v_row_number := v_row_number + 1;

end loop;

Neither of the above works. No error is displayed in Oracle forms.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 20 2018
Added on Mar 21 2018
2 comments
524 views