Skip to Main Content

DevOps, CI/CD and Automation

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!

excel to pdf

535878Mar 30 2011
Hi,

Iam able to generate excel from my Form using ole2 package.

Iam using forms 6i and database 10g.

Following is the procedure to save the file to excel

Procedure save_xl(p_path varchar2,p_excel_name varchar2) is
Begin

OLE2.Release_Obj(worksheet);
OLE2.Release_Obj(worksheets);

If p_path is not null then
Arglist := OLE2.Create_Arglist;
OLE2.Add_Arg(Arglist,p_path||'\'||p_excel_name||'.xls');
OLE2.Invoke(workbook, 'SaveAs', Arglist);
OLE2.Destroy_Arglist(Arglist);
end if;
End;


Now i want to publish pdf file from this generated excel file programatically. Please help

Note : I tried modifying OLE2.Add_Arg(Arglist,p_path||'\'||p_excel_name||'.xls') to OLE2.Add_Arg(Arglist,p_path||'\'||p_excel_name||'.pdf')
but it creates a pdf file but doesnt work. Because it is just saving the file as .pdf instead of .xls its not publising to pdf actually....


Thanks in advance.

Comments

mathguy

According to Morgan's library, this function is undocumented. (Which begs the question - are you using this in a critical production environment, and if so, why?)
https://www.morganslibrary.org/reference/pkgs/dbms_scheduler.html#sched15
In any case - it appears that rprJob is a package (either user-defined or perhaps another Oracle-provided but undocumented) which, among other things, defines the various constants used in your calls. It seems pretty clear that in one environment (the older one) the constants are in fact defined (15, 30 12) while in the other environment they are not. In other words: don't look at the function; look at the values passed to it. Where they come from, and how they are different in the two databases.

User_TK218

@mathguy Thanks for the quick response. I was using this function in oracle 11g now I'm trying to upgrade my version to 18c which made me run into this issue. Also, I've looked at the values that are passed to the function in both versions and they are the same. In Oracle 18c I tried checking their values before and after the function is called and at both the time, the value is as expected(15,30,12). So I don't think there is a value change in the values passed to the function.

GregV

Hi,
As mathguy said, this function is undocumented, so there can be changes from one version to another without notice. It isn't recommended to use undocumented features especially for this reason. Building the repeat_interval string isn't that complicated, so you can very well do it on your own.

mathguy

When troubleshooting, the first task is to localize the issue. If you do want to continue to investigate (at the very least, out of curiosity) - the next thing you might try is to pass hard-coded numeric literals (such as 12, 15 etc.) Does the function, then, work as expected?
If it doesn't, you will know something changed about the function itself, and the problem has nothing to do with the package constants. Conversely, if in that case the function works as expected, you will know that the issue has to do with how the values are passed, and not the function itself. Either way you will have a smaller problem to tackle.

User_TK218

@gregv @mathguy Thanks for your responses. I did try and hard code and pass the values to the function in sqldeveloper still getting a result that is different from the older version. So I've decided to create a string my own or modify the string returned accordingly.

1 - 5
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Apr 27 2011
Added on Mar 30 2011
0 comments
1,199 views