Link to home
Start Free TrialLog in
Avatar of rbgerman
rbgerman

asked on

NEWBIE Q - How to run your report from the form

let's say I created a report that lists all of my employees with the Report Wizard.

In my form, I have a Employee_Info button.  What is the proper SQL to run the report which is called Employee_Report.rdf.

rbg
Avatar of chsoh
chsoh

look for this.

find_report_object
SET_REPORT_OBJECT_PROPERTY
others_property_setting
RUN_REPORT_OBJECT
REPORT_OBJECT_STATUS

if u show your report using web browser,
WEB.SHOW_DOCUMENT
Avatar of rbgerman

ASKER

this is what i had -----

DECLARE
      rep_result VARCHAR2 (30);
DECLARE
      rep_result VARCHAR2 (30);
BEGIN
      SET_REPORT_OBJECT_PROPERTY('EMPLOYEE_REPORT',      REPORT_FILENAME, :GLOBAL.project_path || 'Employee_Report.rdf');
      SET_REPORT_OBJECT_PROPERTY('EMPLOYEE_REPORT',      REPORT_DESNAME, :GLOBAL.project_path || 'Employee_Report.htm');
      rep_result := RUN_REPORT_OBJECT('EMPLOYEE_REPORT');
      WEB.Show_DOCUMENT('file:///' || :GLOBAL.project_path  || 'Employee.htm', '_blank');
END;


can you help me fix it.....it is compiling but when i hit the button, it gives an error about global.project_path...

rbg

is that it...no more help

???
Avatar of Helena Marková
What error do you receive ?
ok

thanks for replying

the first error is:
FRM-40815 - Variable GLOBAL.PROJECT_PATH does not exist
then
FRM-41219 - Cannot find report: invalid ID

then it does them both a few more times

rbg
FRM-40815 - Variable GLOBAL.PROJECT_PATH does not exist

:GLOBAL.PROJECT_PATH:='your_path';

DECLARE
     rep_result VARCHAR2 (30);
BEGIN
:GLOBAL.PROJECT_PATH:='your_path';
     SET_REPORT_OBJECT_PROPERTY('EMPLOYEE_REPORT',     REPORT_FILENAME, :GLOBAL.project_path || 'Employee_Report.rdf');
     SET_REPORT_OBJECT_PROPERTY('EMPLOYEE_REPORT',     REPORT_DESNAME, :GLOBAL.project_path || 'Employee_Report.htm');
     rep_result := RUN_REPORT_OBJECT('EMPLOYEE_REPORT');
     WEB.Show_DOCUMENT('file:///' || :GLOBAL.project_path  || 'Employee.htm', '_blank');
END;
in the line

:GLOBAL.PROJECT_PATH:='your_path';

do i need to put something like 'c:\temp\Oracle_New\';

b/c i would think the entire point of the global.project_path is so you wont have to specify that...especially if my project got moved to a different directory

keep me posted.


rbg
You are rigt. If you use Client/Server, then you set REPORTS60_PATH registry variable and on each client reports are found.
But you use WEB forms and in this case I think that the path is the same for all users.
here's what i tried:

:GLOBAL.PROJECT_PATH:='c:\temp\Oracle_New\';

DECLARE
     rep_result VARCHAR2 (30);
BEGIN
:GLOBAL.PROJECT_PATH:='c:\temp\Oracle_New\';
     SET_REPORT_OBJECT_PROPERTY('EMPLOYEE_REPORT', REPORT_FILENAME, :GLOBAL.project_path || 'Employee_Report.rdf');
     SET_REPORT_OBJECT_PROPERTY('EMPLOYEE_REPORT', REPORT_DESNAME, :GLOBAL.project_path || 'Employee_Report.htm');
     rep_result := RUN_REPORT_OBJECT('EMPLOYEE_REPORT');
     WEB.Show_DOCUMENT('file:///' || :GLOBAL.project_path  || 'Employee_Report.htm', '_blank');
END;

now i am not getting the global error but still getting the cannot find report error (FRM-41219)

and the display at the end is:
FRM-40738: Argument 1 to builtin RUN_REPORT_OBJECT cannot be null...

what gives...this is just a simple report that lists my employees....nothing fancy

rbg
Is your report defined also in a reports node of your form ?
open your oracle form builder
in the object navigator,
you need to create your report object & specified the correct property for your report object.
ok guys...let me increase the points to 50...I am at work now so take your time.  This shows how little I know about Reports.  No, I have not added any report stuff in my forms builder.  Let's take it step by step

1.  Go to the Reports section on the Form Builder
2.  Hit the + button
3.  Use existing report
4.  Change Name in Object Navigator to EMPLOYEE_REPORT
5.  Now what do I do to get it working......????

thanks guys...i think we are almost there

rbg
You have to set another report properties - see "Report Properties" topic and description of each property in the on-line help - especially:
Filename (=EMPLOYEE_REPORT),
Report Destination Type,Report Destination Format.
ok...i know have it saying

REP-0503: You did not specify the name of a report

then it proceeds to open the new web windows with the proper stuff in the address bar, but it is not loading...

???

what steps do I take to get it going

rbg
still wondering what is going on here.....

rbg
RBG,
i will get back to you on this
thomas
ASKER CERTIFIED SOLUTION
Avatar of chsoh
chsoh

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial