Calling reports from forms [message #200225] |
Sun, 29 October 2006 14:07 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
zaghloul
Messages: 9 Registered: October 2006
|
Junior Member |
|
|
Hi!
I am using Oracle 9iDS Report Builder and Oracle 9iDS Form Builder.
I need to know how to call a report from a form (as a preview or HTML), what is the code, the trigger to use, if i'll need a procedure how to link the procedure to that trigger.
|
|
|
|
Re: Calling reports from forms [message #200251 is a reply to message #200225] |
Mon, 30 October 2006 01:25 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
kbhujendra@rediffmail.com
Messages: 26 Registered: June 2006 Location: Hyderabad,India
|
Junior Member |
![kbhujendra%40yahoo.com](/forum/theme/orafaq/images/yahoo.png) ![kbhujendra@gmail.com](/forum/theme/orafaq/images/google.png)
|
|
Hi,
We can call report using WEB.SHOW_DOCUMENT and RUN_REPORT_OBJECT from forms 10g.
The below procedure might be helpful to you.
Program Units:
PROCEDURE run_report_object_proc (
report_id report_object,
report_server_name VARCHAR2,
report_format VARCHAR2,
report_destype_name NUMBER,
report_file_name VARCHAR2,
report_otherparam VARCHAR2,
reports_servlet VARCHAR2
)
IS
report_message VARCHAR2 (100) := '';
rep_status VARCHAR2 (100) := '';
vjob_id VARCHAR2 (4000) := '';
hidden_action VARCHAR2 (2000) := '';
v_report_other VARCHAR2 (4000) := '';
i NUMBER (5);
c CHAR;
c_old CHAR;
c_new CHAR;
BEGIN
SET_REPORT_OBJECT_PROPERTY (report_id, report_comm_mode, synchronous);
SET_REPORT_OBJECT_PROPERTY (report_id, report_filename, report_file_name);
SET_REPORT_OBJECT_PROPERTY (report_id, report_server, report_server_name);
SET_REPORT_OBJECT_PROPERTY (report_id, report_destype,
report_destype_name);
SET_REPORT_OBJECT_PROPERTY (report_id, report_desformat, report_format);
hidden_action :=
hidden_action
|| '&report='
|| GET_REPORT_OBJECT_PROPERTY (report_id, report_filename);
hidden_action :=
hidden_action
|| '&destype='
|| GET_REPORT_OBJECT_PROPERTY (report_id, report_destype);
hidden_action :=
hidden_action
|| '&desformat='
|| GET_REPORT_OBJECT_PROPERTY (report_id, report_desformat);
hidden_action :=
hidden_action
|| '&userid='
|| GET_APPLICATION_PROPERTY (username)
|| '/'
|| GET_APPLICATION_PROPERTY (PASSWORD)
|| '@'
|| GET_APPLICATION_PROPERTY (connect_string);
c_old := '@';
FOR i IN 1 .. LENGTH (report_otherparam)
LOOP
c_new := SUBSTR (report_otherparam, i, 1);
IF (c_new = '')
THEN
c := '&';
ELSE
c := c_new;
END IF;
-- eliminate multiple blanks
IF (c_old = '' AND c_new = '')
THEN
NULL;
ELSE
v_report_other := v_report_other || c;
END IF;
c_old := c_new;
hidden_action := hidden_action || '&' || v_report_other;
hidden_action :=
reports_servlet
|| '?_hidden_server='
|| report_server_name
|| hidden_action;
SET_REPORT_OBJECT_PROPERTY (report_id,
report_other,
'pfaction='
|| hidden_action
|| ' '
|| report_otherparam
);
-- run Reports
report_message := RUN_REPORT_OBJECT (report_id);
rep_status := REPORT_OBJECT_STATUS (report_message);
IF rep_status = 'FINISHED'
THEN
vjob_id :=
SUBSTR (report_message,
LENGTH (report_server_name) + 2,
LENGTH (report_message)
);
web.show_document ( reports_servlet
|| '/getjobid'
|| vjob_id
|| '?server='
|| report_server_name,
' _blank'
);
ELSE
--handle errors
NULL;
END IF;
END LOOP;
END;
In when-Button-Pressed call this procedure.
If you want detailed below links will be helpful
http://www.oracle.com/technology/products/forms/techlisting10g.html
http://www.oracle.com/technology/products/forms/pdf/frm9isrw9i.pdf
Thanks,
Bhujendra
|
|
|
Re: Calling reports from forms [message #244331 is a reply to message #200251] |
Tue, 12 June 2007 06:33 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
ursnuts
Messages: 7 Registered: June 2007 Location: chennai
|
Junior Member |
|
|
Hi,
Gr8 Procedure..
I got a doubht in passing parameters...
declare
a report_object;
begin
a:=find_report_object('report2');
run_report_object_proc(a,'localhost','HTML',CACHE,'D:\Testalmas\test.rdf',100,'http://localhost:8889/reports');
end;
this is how i caled ur procedure....but its not working...
and for report_otherparam i gave blank...im not sure abt the values of that parameter..
can you plz post the calling code also...
then it will be so helpful
thanks in advance
|
|
|
|