komedit1
komedit1

Reputation: 255

Calling reports from forms without displaying the form

As the title says, I would like to call the reports from forms without actually displaying the form. I am very new to Oracle forms. I tried to do the following but it didn't work:

1)Inserted the code to call the reports in WHEN-NEW-FORM-INSTANCE trigger.

2)Removed the canvas so that the form won't be displayed.

But I got the error

RM-30173: Module contains no canvases

Is it possible to do this?. I am trying to display the report when a menu item in an oracle forms application is clicked which in turn would call the above form but directly displaying the report instead of displaying an UI.

Update:

I am using Forms Builder 10.1.2.

As for why I don't want to do this directly in the menu(MMB), the menu doesn't have an option to attach a report and I've already got a working form that generates an report but the code to call the report is written in a button-pressed trigger.

In, http://forums.oracle.com/forums/thread.jspa?threadID=1107427&tstart=45, I am trying to do what Andreas Weiden, suggested in that thread.

Upvotes: 1

Views: 3288

Answers (5)

devdar
devdar

Reputation: 5654

You could have also just created the report and just call it behind the menu option but hiding the report parameter form and the report would automatically begin to generate. In the menu option just before you call the report name just set the report paramform to hide and destype to screen. This would have save the trouble of creating a blank canvas and maybe having to suppress error messages if any was thrown.

Upvotes: 0

komedit1
komedit1

Reputation: 255

I solved the problem by creating a blank canvas in the 'dummy form' as 'FRM-30173: Module contains no canvases' was returned when no canvas was found in the form.

The approach suggested by Andreas Weiden here: http://forums.oracle.com/forums/thread.jspa?threadID=1107427&tstart=45 works well.

Upvotes: 1

Jeffrey Kemp
Jeffrey Kemp

Reputation: 60312

Move the code from the form's button into a procedure in a common library. Attach the library to the form and to the menu module. Call the procedure from both the form button as well as the menu.

Upvotes: 1

DCookie
DCookie

Reputation: 43543

I am only familiar with Reports 6i, and it was simple to just run the report from the menu.

We created a menu item that was PL/SQL Command Type, dropped the code to run the report module in the Menu Item Code box, and all was good. I'd be surprised if you couldn't do something similar in 10g reports.

Upvotes: 1

Jim Hudson
Jim Hudson

Reputation: 8079

I think your problem may be in limiting your menu options to only opening forms.

For example, you could instead have the menu in your form execute a form trigger which would call the report. Or a web.show_document to the url for the Report.

What version of Forms are you on? It's been a while since I did much with Forms, but this may give you a start.

Upvotes: 1

Related Questions