Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to use report + form func in procs in libraries 1

Status
Not open for further replies.

vchen7

Programmer
Mar 15, 2004
17
PF
hi all,
I try to use reports (functions : srw.message and srw.program_abort...) in a procedure PROC_REP and forms (exit_form and show_alert...) in a procedure PROC_FMX

Both procedures PROC_REP and PROC_FMX are stored in a library LIB.
This library LIB is attached to reports and forms.

When I convert (using reports converter) the library, it wouldn't fail. (using forms compiler, it fails errors on srw etc...)

When I compile the forms (referencing LIB), it wouldn't fail either.

But, when I run the forms, it would fail ORA-06508 (could not find program unit being called).

any advice?

Thank you in advance,
Vincent
 
I've solved this with the following trick (don't remember details for sure, so try to reproduce it in general).

Localize your forms/reports specific code in different libraries with similar signatures and place them into different folders (I created SHOW_ERROR and EXIT_MODULE procedures); list that folders in FORMS_PATH/REPORTS_PATH respectively; create common library and attach 1 of that libraries to it (don't mention path explicitely!). List this library location in both variables. Now when you call this library from one of products it in turn would call an appropriate module.

Regards, Dima
 
Hi Dima,
thank you for your response (and moreover fast)

it looks nice a solution

next to it, I am looking for a way to bypass srw.message and srw.program_abort.

Vincent
 
What do you mean by "bypass"? You should compile reports library by Reports, forms - by Forms, and then the main module wherever you want. In any case SRW package is not visible from Forms as a built-in so you have no chance to compile a module that references it from Forms. As well as some program units from Standard extension are not known for Reports. You may replace inappropriate (implemented only in single product) commands by stubs.
BTW, why do you need it?

Regards, Dima
 
Hi Dima,
Thanks again for reply.

bypass : I meant avoid using srw.message and srw.program_abort

replace commands by stubs : Can you explain me a stub and the usage please?

Why I need : I attached a library LIB to every forms/reports
I would like to show error and exit a forms/reports in a definite condition.
I created two procedures(or can gather the code in one).
So in one case I use alert and exit_form in the other case I use srw.message and srw.program_abort(or can use boolean instead).
But both procedures have quite similar code except the show error and exit program.


Result : If I can avoid at least srw.message
1/ I will use only one procedure
2/ usable for forms and reports

Thanks for advice,
Vincent.
 
Stub is a dummy function with specific signature that in fact does nothing (or about nothing). It may be used to keep the same set of procedures when an action is not defined for specific product.

Try to create 2 different libraries with the same name ALERT:
both should contain SHOW_ERROR_SPC and EXIT_MODULE_SPC procedures. Forms version calls MESSAGE() (or SHOW_ALERT()) and EXIT_FORM; Reports one calls SRW.MESSAGE and SRW.PROGRAM_ABORT respectively. Then create "common" library with attached ALERT library and procedures SHOW_ERROR_UNF and EXIT_MODULE_UNF that call SHOW_ERROR_SPC and EXIT_MODULE_SPC respectively.



Regards, Dima
 
Hi Dima,
Thanks a lot for your patience and interest.

I did not think of that way, so thank you very much for the tip.

But I got a problem.
I created two libraries named ALERT (not in the same location). I then use my "common" library LIB. Let us remember that LIB must be attached to every forms and reports. I tried to attach the two libraries ALERT(one for forms, the other one for reports) to LIB, it only attaches the utter, actually.

I then tried with the 'remember the path/do not delete the path' option (I don't know in English, I use French Developer6.0) which shows when I try to attach a library. Same result.

I suppose there is a deadend.

Well, as you seem to show interests, I am telling you the context.

Today, we use a library LIB in every forms and none to any reports. I, first, intended to show error and exit in a particular case : I check the version of the form stocked in a constant in When-New-Form-Instance and compare it to the version stocked in database. I add the procedure in LIB. Succeeded.

But then, I wanted to do so with reports, saving the version of the report in a constant in Before-Report trigger.

My boss would really appreciate that I do not create a library with only a procedure that checks the version of reports. Thus, she wanted me to use the same library LIB as forms. Here is the deal.

I guess in earlier versions 6i (with version controlling) and 9i (Software Configuration Manager), it would be easier, but we are not planning to upgrade Developer6.0

Thank you for your understanding Dima,
I hope people help you the same way you did.

Vincent
 
First of all, to get text in English you may change your NLS_LANG setting (for some time). Actially I use Russian thus have the same pain :)
Then, you should remove path when attaching module-specific library to a common one, not when attaching a common library to a module. I've just successfully tried it again, it works. Besides placing ALERT libraries to different folders you should also list each of them in FORMS60_PATH/REPORTS60_PATH correspondingly.

Regards, Dima
 
Hi Dima,
wow I guess you had some hard time at your beginning in Forms unless you (and you surely do) speak english when sending requests in forums
Thanks for the tip, I just "found out" that my forms_path and reports_path target the same directory for libraries. Well, I do not have the access to modify reports_path at end-users' pc.
Version Controlling is not urgent and is more transparent for end-users, so I have been assigned to tasks more "visible" to end-users. But, it is saving life time, to know that they currently use the more updated version of a form when they report bugs or so.

Hoping to help you someday for anything,
Vincent
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top