Report_object_status
Hi all,
While calling a report from Oracle Forms (10g), do we need to call the Report_object_status in a loop or should it be called just once
for example : should the code be as follows
1) Report_message := Run_report_object (Report_id);
Rep_status := Report_object_status (Report_message);
While Rep_status In ('RUNNING','OPENING_REPORT','ENQUEUED')
Loop
Rep_status := Report_object_status (Report_message);
End Loop;
IF Rep_status = 'FINISHED'
THEN
ELSE
END IF;
OR
2) Report_message := Run_report_object (Report_id);
Rep_status := Report_object_status (Report_message);
IF Rep_status = 'FINISHED'
THEN
ELSE
END IF;
Kindly let me know.
Thanks in advance.
Better would be
PROCEDURE prc$run_rep(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 reports running parameters
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);
message('test1');
-- creating string for pfaction parameter
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);
-- report other parameters are passed as key value pairs
-- "key1=value1 key2=value2"
-- The following loop replaces the delimited blanks with an '&' used on the web.
-- This replacements only works for values that don't have blanks themselves.
message(hidden_action);
-- c_old is initialized as a dummy value
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;
-- save current value as old value
c_old := c_new;
END LOOP;
hidden_action := hidden_action ||'&'|| v_report_other;
-- report_servlet contains the full path to the reports servlet
-- Example 1 : Forms and reports areon the same server
-- report_servlet :='/reports/rwservlet'
-- Example 2 : Forms and reports are on different hosts
-- report_servlet := 'http://host:port/reports/rwservlet'
hidden_action := reports_servlet||'?_hidden_server='||report_server_name|| fnc$encode(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 prc$run_rep;
Similar Messages
-
REPORT_OBJECT_STATUS error
I get the following error when I run the builtin REPORT_OBJECT_STATUS after running the builtin RUN_REPORT_OBJECT:
'FRM-40738: Argument 1 to builtin REPORT_OBJECT_STATUS cannot be null'
My form is displaying fine with no errors.
My code looks like this:
DECLARE
repid REPORT_OBJECT;
v_rep VARCHAR2(100);
rep_status varchar2(20);
BEGIN
repid := FIND_REPORT_OBJECT('tape_log_report');
v_rep := RUN_REPORT_OBJECT(repid);
rep_status := report_object_status(v_rep);
END;
And the properties for my report are as follows:
Execution Mode: Runtime
Communication Mode: Asynchronous
Report Destination Type: screen
Anybody have any idea what is going on here?
Thank you
nullTodd,
Report_object_status and copy_report_object_output should be used only with the reports server. They are not supported by the reports background engine.
When RUN_REPORT_OBJECT is called on a report object with a blank 'Report Server' property, the return value will be NULL.
Thus, when running a report in this manner, the functions REPORT_OBJECT_STATUS
and COPY_REPORT_OBJECT_OUTPUT are not supported (because they require an
id value to be returned from RUN_REPORT_OBJECT.)
Best Regards,
Deepak Rai -
Report_Object_Status TERMINATED_WITH_ERROR
Hello Experts,
Greetings to everybody!!!
First of all, I am very excited to give Oracle Fusion Middleware Forms11g R2 a try finally. But i am completely new to this, only experience i got is with forms6i with client-server architecture. I managed to install Oracle Fusion Middleware whole package on my test server(Microsoft Windows Server 2003 R2,Enterprise x64 Edition,Service Pack 2) and got the testing done successfully(thanks to oracle documentation) against Oracle 9i R2 database which is residing on another server on our network. I could run forms, reports individually,successfully. But, my problem is, when i try to call the report from forms using WEB.SHOW_DOCUMENT it WORKS FOR FEW TIMES and then starts throwing the following error.
TERMINATED_WITH_ERROR
Then i learned that Report_Object_Status status is not FINISHED and i have no clue about how to get it done. So, i decided to call the report with the status TERMINATED_WITH_ERROR then it gives me the following error.
REP-52251: The output of job ID 113 requested on Thu Jun 13 23:54:14 PDT 2013 cannot be retrieved.<P>REP-51026: No output is generated for job 113.
I am not posting the code here thinking that it might not be necessary as it work's few times then don't. So, i'm wondering if it is got to do anything with the configurations on the server. I would be really grateful if you could help me out in this regard.
Thank YouReports Server Queue Status is as follows
The report terminated with error:
REP-110: File Testbill.rdf cannot be opened. REP-1070: An error occurred while opening or saving a document. REP-0110: File Testbill.rdf cannot be opened. .
By the way, i tried making the reports path length in registry very short as suggested by numerous people. But, nothing worked so far. -
Polling the status of report_object_status
Instead of using a WHILE LOOP to get the get 'FINISHED' status of the report, any number of loops is suggested if we want to have a time out for this polling method?
Say
FOR i in 1..500? 1000? LOOP
END LOOP
anyone can give me a hint?
ThanksYou probably don't need this piece of code (the loop to check report status). It is usually used to wait for a report to finish, before calling the output with web.show_document.
If you run the report in SYNCHRONOUS mode, this loop is not necessary. See the online help:
Synchronous specifies that control returns to the calling application only after the called product has finished. -
Reg: sending an email using report server
Hi,
i am using the below code to send an email using the report server.
When send button Click:
DECLARE
PL_ID ParamList;
repid REPORT_OBJECT;
v_rep varchar2(100);
rep_status varchar2(20);
l_host_name varchar2(50);
l_port_num varchar2(10);
l_server_name varchar2(50);
l_month_name varchar2(20);
l_from varchar2(50);
l_to varchar2(50);
l_cc varchar2(50);
l_property varchar2(1000);
l_sub_out varchar2(200);
l_sub varchar2(400);
L_BODY VARCHAR2(1000);
l_email_dir varchar2(50);
BEGIN
l_sub:=:block1.number||' '||replace(replace(:block1.desc,'&','ampersand'),'''','$quote');
if length(l_sub) >150 then
l_sub_out:=substr(l_sub,0,150);
else
l_sub_out:=l_sub;
end if;
l_host_name := (i used my host ip address local host);
l_port_num := '8889';
l_email_dir := 'C:\forms\';
l_from := [email protected];
l_cc := [email protected];
L_BODY:=' Please refer to the attached abc Report';
repid := find_report_object('PRINT_REPORT');
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_FILENAME,'abc');
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESTYPE,MAIL);
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESFORMAT,'PDF');
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_SERVER,l_server_name);
go_block('abc_MAIL_TO');
first_record;
if :abc.email_address is not null then
loop
l_to:=:abc.email_address;
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER, 'paramform=no DISTRIBUTE=YES DESTINATION='||l_email_dir||'test.xml'||' '||
' p_2='|| TO_CHAR(:control.sessionid)||' '||'P_ID='||TO_CHAR(:block1.ID)||' '
||'P_LIST_TYPE='||'A'||' '
||'DISTRIBUTE=YES DESTINATION=test.xml'||' '
||'P_FROM='||''''||l_from||''''||' '
||'P_SEND='||''''||l_to||''''||' '
||'P_CC='||''''||l_cc||''''||' '
||'P_FILE='||'C:\testfile.txt'||' '
||'p_email_path='||l_email_dir||' '
||'P_BODY='||''''||l_body||''''||' '
||'P_NUM='||''''||'Email report: '||l_sub_out||'''');
v_rep := RUN_REPORT_OBJECT(repid);
rep_status := REPORT_OBJECT_STATUS(v_rep);
WHILE rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED')
LOOP
rep_status := report_object_status(v_rep);
END LOOP;
IF rep_status = 'FINISHED' THEN
null;
ELSE
message(rep_status);
message('Error when sending email to: '||l_to);
END IF;
if :system.last_record='TRUE' then
exit;
else
next_record;
end if;
end loop;
end if;
message ('Mail has been sent.');
END;
In the report:
I created all the required parameters and i wrote a trigger as
function AfterPForm return boolean is
dst_file text_io.file_type;
l_email_dir varchar2(50);
begin
dst_file := text_io.fopen(:p_email_path||'test.xml','w');
text_io.putf(dst_file, '<destinations>'||chr(13));
text_io.putf(dst_file, '<mail id="ex1" '||chr(13));
text_io.putf(dst_file, 'from="&P_FROM"'||chr(13));
text_io.putf(dst_file, 'to="&P_SEND"'||chr(13));
text_io.putf(dst_file, 'cc="&P_CC"'||chr(13));
text_io.putf(dst_file, 'subject="&<P_NUM>">'||chr(13));
text_io.putf(dst_file, '<body srcType="text">'||chr(13));
text_io.putf(dst_file,'<![CDATA>'||chr(13));
text_io.putf(dst_file, '</body>'||chr(13));
text_io.putf(dst_file, '<foreach>'||chr(13));
text_io.putf(dst_file, '<attach format="pdf" name="report.pdf" srcType="report" instance="all">'||chr(13));
text_io.putf(dst_file, '<include src="mainSection"/>'||chr(13));
text_io.putf(dst_file, '</attach>'||chr(13));
text_io.putf(dst_file, '</foreach>'||chr(13));
text_io.putf(dst_file, '</mail>'||chr(13));
text_io.putf(dst_file, '</destinations>'||chr(13));
text_io.fclose(dst_file);
return (TRUE);
end;
Then after compilation i click the button send. Then i got the message as
Mail has been sent to [email protected].
But i didn't receive any mail.
then i check the report job id. It was showing job was successful .
And i check whether the test.xml file was created or not. It has created the test.xml file as below:
<destinations>
<mail id="ex1"
from="&P_FROM"
to="&P_SEND"
cc="&P_CC"
subject="&<P_NUM>">
<body srcType="text">
<![CDATA Please refer to the attached abc Report]>
</body>
<foreach>
<attach format="pdf" name="report.pdf" srcType="report" instance="all">
<include src="mainSection"/>
</attach>
</foreach>
</mail>
</destinations>
I have 2 machines having dev 10g. one machine is working fine with this code. but in my machine it was not working.
Do any one of you had a solution for my case.
Thanks in advance.
Edited by: user648380 on Dec 29, 2009 5:59 PMSorry to all.
I made a mistake in the from email address.
Instead of gmail.com i had given gmail,com
I am really sorry about it. -
Print a report to a specific printer from Forms
I have a form from where i want to print a report to a specific printer (not the default printer). Is there any way to do this from Forms 9i. Im using the Orarrp but it pops up the printer dialog and shows the default printer. Is there any way to harcod the printer name. the printer is on the network..
If i go to my control pannel and see the list of printers i take the printer name from there. should i put the path of the printer? i kno the port of the printer .it come like ip_192.1.11.1_p1 ..how do i define the printer name? if i dnt give the printer name shouldnt if fire to the default printer ..my code is as follows
declare
REPID REPORT_OBJECT;
V_REP VARCHAR2(100);
REP_STATUS VARCHAR2(20);
BEGIN
REPID := FIND_REPORT_OBJECT('CUS_PRINT');
SET_REPORT_OBJECT_PROPERTY(REPID,REPORT_EXECUTION_MODE,BATCH);
SET_REPORT_OBJECT_PROPERTY(REPID,REPORT_COMM_MODE,SYNCHRONOUS);
SET_REPORT_OBJECT_PROPERTY(REPID,REPORT_DESTYPE,PRINTER);
SET_REPORT_OBJECT_PROPERTY(REPID,REPORT_SERVER,'test');
SET_REPORT_OBJECT_PROPERTY(REPID,REPORT_OTHER,'P_CUSREF='||:CTRL01.CUSREF||' PARAMFORM=NO');
MESSAGE('SET REPORT PROP');
V_REP := RUN_REPORT_OBJECT(REPID);
REP_STATUS := REPORT_OBJECT_STATUS(V_REP);
MESSAGE('RAN REPORT');
WHILE REP_STATUS IN ('RUNNING','OPENING_REPORT','ENQUEUED') LOOP
REP_STATUS := REPORT_OBJECT_STATUS(V_REP);
END LOOP;
IF REP_STATUS = 'FINISHED' THEN
IF NVL('TEST',' ') <> ' ' THEN
GEN_ALERT('NULL_ALERT','TEST');
END IF;
ELSE
GEN_ALERT('NULL_ALERT','Error when running report');
END IF;
END;
what should the desformat of the report should be..when im trying to run this it gives me 'no data found' error...why??? -
Can you open a report in Excel/Word desktop instead of the web pugin?
using run_report_object( and web.show_document,
how or can you get a report to open in the desktop/full version of MS Excel/Word instead of the web plugin versions?
I can get the browser to open a report in pdf with my desktop adobe reader, but not with an rtf or xml/delimited desformat.
Currently I don't pass a mimetype when opening as a pdf, but I do pass one in the url when i am destypes of xml, delimited and rtf,
as this is the only way i have found out how to open the reports in word/excel.
I'm in the process of upgrading from forms 6 client/server to 10g developer suite, so this is my try with a web based system.
Does anyone have any suggestions, or where I should look.
Below I listed my code from a procedure.
the first part of the procedure is alot of converting, but if you skip down to the part between the 2 sets of double lines this fairly standard.
PACKAGE BODY pmc_lib IS
-- Procedure to run the report.
procedure run_reports(v_report_name in varchar2, -- Report Name with or w/o a path.
v_commode in number default synchronous, -- commode
v_execmode in number default runtime, -- execute mode
v_file_sys in number default filesystem, -- dummy
v_param_list in paramlist, -- parameter list
v_show_modes in varchar2 default null) is -- used for testing,
-- if set to anthing but null, the report properties will display
-- on the screen through an alert prior to printing.
v_errorcode number;
v_errortext varchar2(600);
v_initialized boolean := false;
v_prop_reportserver varchar2(200);
v_report_path varchar2(200);
v_user varchar2(100);
v_user_sessionid number;
v_forms_version varchar2(100);
v_default_report_server varchar2(200);
v_default_server_domain_path varchar2(200);
v_connect_string varchar2(3) := get_application_property(connect_string);
v_user_name varchar2(35) := get_application_property(username);
report_id report_object;
reportserverjob varchar2(100);
v_jobid varchar2(100);
rep_status varchar2(100);
v_url varchar2(500);
v_url2 varchar2(500);
v_parameter_value varchar2(100);
v_destype_param_value varchar2(100) := null;
v_desformat_param_value varchar2(100) := null;
v_desname_param_value varchar2(100) := null;
v_value_n number := 0;
v_param_type number := text_parameter;
v_prop_execmode number;
v_prop_commode number;
v_prop_destype number;
v_prop_filename varchar2(200);
v_prop_source_block varchar2(200) := null;
v_prop_query_name varchar2(200) := null;
v_prop_desname varchar2(200) := null;
v_prop_desformat varchar2(200) := null;
v_prop_reportserver varchar2(200) := null;
v_prop_other varchar2(200) := null;
v_mimetype varchar2(200) := null;
v_selected_mimetype varchar2(200) := null;
report_not_generated exception;
report_id_not_found exception;
BEGIN
v_forms_version := get_application_property(version);
v_prop_reportserver := get_report_object_property('report1', report_server);
v_report_path := null;
v_user := v_user_name || '/' ||
get_application_property(password) || '@' ||
v_connect_string;
if v_connect_string = 'NNN' then
v_default_server_domain_path := 'pmcoracapp01.aapmc.com/reports/rwservlet';
v_default_report_server := 'rep_pmcoracapp01_frhome1';
else
v_default_server_domain_path := 'oradevsrv.aapmc.com/reports/rwservlet';
v_default_report_server := 'rep_oradevsrv_frhome1';
end if;
v_initialized := true;
-- Check to see what version of forms is running.
if substr(v_forms_version, 1, 1) <> '6' then
-- Check to see if WEB version is running
-- This may be an unnecessary check.
if (get_application_property(user_interface) = 'WEB') then
report_id := find_report_object('report1');
-- id_null won't work on a report_id in Version 6, may put back in 10g once version 6 is gone completly
-- if id_null(report_id) then
-- raise report_id_not_found;
-- end if;
-- Because of Convertions from old system the following are needed.
-- 1) If 'execmode' is runtime, then change it to batch.
if v_execmode = runtime then
v_prop_execmode := batch;
else
v_prop_execmode := v_execmode;
end if;
-- 2) If Report name has an attached path, then remove it.
v_value_n := instr(lower(v_report_name), 'k:\pmc\new\');
if v_value_n = 0 then
v_prop_filename := v_report_name;
else
v_prop_filename := substr(v_report_name, v_value_n + 11);
end if;
-- From looking at the FORMS, 'destype' parameter is always passed in from the FORM.
-- It is either 'preview' or 'file'.
-- This is here for the converstion from Forms 6 to 10g.
-- If for some reason destype has not been passed in as a parameter, you will get a FORM error,
-- saying the parameter does not exists.
begin
-- 3) If 'destype' is one of the following, then change it to cache.
get_parameter_attr(v_param_list, 'destype', v_param_type, v_destype_param_value);
if lower(nvl(v_destype_param_value, 'null')) in ('preview', 'file', 'null') then
v_prop_destype := cache;
-- 3a) If 'destype' was = 'file' then check the 'desformat' and 'desname'.
if lower(nvl(v_destype_param_value, 'null')) = 'file' then
-- 3b) Get 'desformat' value
get_parameter_attr(v_param_list, 'desformat', v_param_type, v_desformat_param_value);
-- 'delimited' was not working, so change all 'delimited' to 'delimiteddata'.
if lower(nvl(v_desformat_param_value, 'null')) = 'delimited' then
v_desformat_param_value := 'delimiteddata';
end if;
-- 3c) If 'desformat' is NOT one of the following, then change it to pdf.
if lower(nvl(v_desformat_param_value, 'null')) not in ('pdf', 'xml', 'rtf', 'delimiteddata') then
v_prop_desformat := 'pdf';
else
v_prop_desformat := lower(v_desformat_param_value);
end if;
-- 4) Get 'desname' property.
get_parameter_attr(v_param_list, 'desname', v_param_type, v_desname_param_value);
v_prop_desname := lower(v_desname_param_value);
end if;
else
v_prop_destype := lower(v_destype_param_value);
end if;
exception
when others then
null;
end;
-- If a desformat is rtf, xml, or delimited then get a mimetype to pass to the url
if lower(v_prop_desformat) = 'rtf' then
v_mimetype := '&mimetype=application/msword';
elsif lower(v_prop_desformat) = 'xml' then
v_mimetype := '&mimetype=application/vnd.ms-excel';
elsif lower(v_prop_desformat) = 'delimiteddata' then
v_mimetype := '&mimetype=application/vnd.ms-excel';
end if;
-- 6) If the Following are not set within the Report Object then
-- set them to the following defaults.
-- These are al required to be set for the Report Object to Function.
-- These are the defaults for AAPMC.
v_prop_execmode := nvl(v_prop_execmode, batch);
v_prop_commode := nvl(v_prop_commode, synchronous);
v_prop_destype := nvl(v_prop_destype, cache);
v_prop_desformat := nvl(v_prop_desformat, 'pdf');
v_prop_reportserver := nvl(v_prop_reportserver, v_default_report_server);
-- Set All Report_Object Properties
set_report_object_property(report_id, report_execution_mode, v_prop_execmode);
set_report_object_property(report_id, report_comm_mode, v_commode);
set_report_object_property(report_id, report_destype, v_prop_destype);
set_report_object_property(report_id, report_filename, v_prop_filename);
set_report_object_property(report_id, report_source_block, v_prop_source_block);
set_report_object_property(report_id, report_query_name, v_prop_query_name);
set_report_object_property(report_id, report_desname, v_prop_desname);
set_report_object_property(report_id, report_desformat, v_prop_desformat);
set_report_object_property(report_id, report_server, v_prop_reportserver);
set_report_object_property(report_id, report_other, v_prop_other);
-- Run Report_Object
reportserverjob := run_report_object(report_id, v_param_list);
v_jobid := substr(reportserverjob, length(v_prop_reportserver) + 2, length(reportserverjob));
-- If Report Status is not 'FINISHED', then loop till it is.
if reportserverjob is not null then
rep_status := report_object_status(reportserverjob);
while rep_status in ('RUNNING', 'OPENING_REPORT', 'ENQUEUED') loop
rep_status := report_object_status(reportserverjob);
end loop;
if rep_status <> 'FINISHED' then
raise report_not_generated;
end if;
-- Create 1st part of url.
v_url := 'http://' || v_default_server_domain_path || '/getjobid' || v_jobid || '?server=' || v_prop_reportserver;
-- Check for mimetype.
if v_mimetype is not null then
v_url := v_url || v_mimetype;
end if;
-- Final part of url.
v_url2 := 'javascript:window.open("' || v_url || '", "", "fullscreen=no, titlebar=no, location=no, toolbar=no, menubar=no, status=no, resizable=yes"); self.close()';
-- This is the built-in that calls a new browser window
web.show_document(v_url2,'_blank');
else
raise report_not_generated;
end if;
end if;
-- Destroy the parameter list.
destroy_parameter_list(v_param_list);
else
-- This section if for Client Server, Version 6 of forms.
-- It will do the same as before the conversion.
-- It is only used before the complete conversion.
if v_report_name is null then
return;
end if;
v_value_n := instr(v_report_name, 'k:\pmc\new\');
if v_value_n = 0 then
v_prop_filename := 'k:\pmc\new\' || v_report_name;
else
v_prop_filename := v_report_name;
end if;
run_product(reports,
v_prop_filename,
v_commode,
v_execmode,
filesystem,
v_param_list,
null);
end if;
-- create history record of the report being run
insert into pmc_report_history values(
s_pmc_report_history.nextval,
v_prop_filename,
v_user_name,
sysdate,
v_forms_version,
v_jobid,
v_destype_param_value,
v_desformat_param_value,
v_desname_param_value,
v_prop_destype,
v_prop_desformat,
v_prop_desname,
v_mimetype,
v_window_open_params);
commit;
exception
when report_id_not_found then
show_user_alert('ERROR: Cannot Find Report Object!', null);
when report_not_generated then
show_user_alert('ERROR: Report Not Generated!', null);
when others then
v_errorcode := SQLCODE;
v_errortext := SQLERRM;
show_user_alert('ERROR : ' || v_errorcode || ' = ' || v_errortext, null);
end;
end;What you could try is downloading the report to the client pc using WEBUTIL_FILETRANSFER.URL_TO_CLIENT, then open the locally save file using something like:
CLIENT_HOST('cmd /c rundll32.exe url.dll,FileProtocolHandler "localfilename"'); -
FRM-92101 error while running report from a button or menu
Hi All,
I am getting the error FRM-92101 while running report without parameter from a button or menu. I am using Developer Suit 10g. I get the error as it shows there has some configuration problem in my form. Will you please help me anyone how can i solve the problem. My previous forms running very well both with parameter and without parameter.
ArifHello Sir,
Thanks for your cooperation. I have solved my problem by myself. The fact was that, when i tried with the following code which made my report---
SELECT br.bid, br.bname, br.branchtxnstatus, dif.difference
FROM branch br,
(SELECT gladbrid branchid,
SUM
(CASE
WHEN ga.gl_acc_categry IN ('L', 'I')
THEN gd.gladbalance
ELSE -1 * gd.gladbalance
END
) AS difference
FROM glaccount ga, glaccountdetail gd
WHERE ga.glid = gd.gladglid
GROUP BY gladbrid) dif
WHERE dif.branchid = br.bid AND br.branchtxnstatus = :Br_Status
and dif.difference!=0
ORDER BY br.bid;
and the code against the button or menu item is---
DECLARE
repid REPORT_OBJECT;
v_rep VARCHAR2(100);
rep_status VARCHAR2(20);
BEGIN
repid := FIND_REPORT_OBJECT('ASSET');
v_rep := RUN_REPORT_OBJECT(repid);
rep_status := REPORT_OBJECT_STATUS(v_rep);
WHILE rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED')
LOOP
rep_status := report_object_status(v_rep);
END LOOP;
IF rep_status = 'FINISHED' THEN
/*Display report in the browser*/
WEB.SHOW_DOCUMENT('http://192.168.0.21:8889/reports/rwservlet/getjobid'||
substr(v_rep,instr(v_rep,'_',-1)+1)||'?'||'server=repserver90','_blank');
ELSE
message('Error when running report');
END IF;
Clear_message;
END;
Clear_message;
which has shown the error FRM-92101 and didn't run the report.
In that case I have changed the query to run the report. first of all i create a view following the query and build the report using a simple select query. that's etc. my report running fine now.
It is mentioned that there had no error on my codes.
Arif -
Error running 9i reports from forms.
Hi folks,
i am having problems running 9i reports from a form.
i have installed Oracle 9iDS on a Win XP machine with 256 MB RAM and a Pentium 1.4Ghz processor.
i also have a local Oracle 9i database. i have created several reports that i am trying to run from some forms but all efforts to date have failed.
below is some sample code.
declare
v_rid report_object;
v_rjob varchar2(100);
v_rptstatus varchar2(100);
v_jobid varchar2(100);
BEGIN
/*get handle to report object itself*/
v_rid := find_report_object('pbranchlist');
set_report_object_property(v_rid,REPORT_EXECUTION_MODE,BATCH);
set_report_object_property(v_rid,REPORT_DESFORMAT,'htmlcss');
set_report_object_property(v_rid,REPORT_DESTYPE,'CACHE');
set_report_object_property(v_rid,REPORT_SERVER,'repsrv');
set_report_object_property(v_rid,REPORT_COMM_MODE,synchronous);
v_rjob := run_report_object(v_rid);
v_rptstatus := report_object_status(v_rjob);
while v_rptstatus in ('RUNNING','OPENING_REPORT','ENQUEUED') loop
v_rptstatus := report_object_status(v_rjob);
message(v_rptstatus);
end loop;
if v_rptstatus = 'FINISHED' then
/*display report in browser*/
-- web.show_document('http://steve:8888/reports/rwservlet/getjobid'||
-- substr(v_rptsvrjob,instr(v_rptsvrjob,'_',-1)+1)||'?'||'server=repsrv','_blank');
web.show_document('/reports/rwservlet/getjobid'||substr(v_rjob,instr(v_rjob,'_',-1)+1)||'?'||'server=repsrv','_blank');
else
message('error running Report');
end if;
end;
pbranchlist is defined in the form,
repsrv is a report server i installed and explicitly started.
on clicking the button to run the above code, i get a message on the browser status bar as follows
opening http://steve:8888/reports/rwservlet/getjobid11?server=repsrv...
that's it. it stays like that forever and a progress bar showing the status of the operation gets to the halfway mark and stays there for up to 15 minutes.
I eventually halted the operation by clicking the stop button of the browser. The form then becomes totally non-responsive with the mouse indicator changing to the hour-glass shape and a small vertical bar moving rapidly back and forth at the bottom of the form window.
My only recourse then is to explicitly close the browser window.
I have already configured Reports to run in non single sign-on mode by setting SINGLESIGNON=NO in the rwservlet.properties file.
Is there anything i have not done properly?
Thanks in advance.Steve,
can you check the Reports cache directory if the Reports file got created? I would assume yes, but better check.
Frank -
[Urgent Help Required] Report not displaying
Dear All,
Please help me with a issue in running report from form. I am using the following code to run a report from a form. The issue is that when i click the button i get all the success messages which are in the code and a new browser window opens but my report is not displaying. Please can any one help me with this issue. I have to submit my project with a week so this is very urgent.
This is the code I am using:
DECLARE
v_report_id Report_Object;
vc_report_job_id VARCHAR2(100); /* unique id for each Report request */
vc_rep_status VARCHAR2(100); /* status of the Report job */
BEGIN
/* Get a handle to the Report Object itself. */
v_report_id:= FIND_REPORT_OBJECT('REPORT7');
message ('report found');
SET_REPORT_OBJECT_PROPERTY(v_report_id,REPORT_COMM_MODE, SYNCHRONOUS);
SET_REPORT_OBJECT_PROPERTY(v_report_id,REPORT_DESTYPE,cache);
SET_REPORT_OBJECT_PROPERTY(v_report_id,REPORT_DESFORMAT,'HTML');
SET_REPORT_OBJECT_PROPERTY(v_report_id,REPORT_SERVER, 'repserver90');
vc_report_job_id:=RUN_REPORT_OBJECT(v_report_id);
message (vc_report_job_id);
vc_rep_status := REPORT_OBJECT_STATUS(vc_report_job_id);
message (vc_rep_status);
IF vc_rep_status='FINISHED' THEN
web.show_document 'http://localhost:8888/reports/rwservlet/getjobid='||vc_report_job_id ||'?server='|| 'repserver90','_blank');
ELSE
message ('Report failed with error message '||vc_rep_status);
END IF;
END;Any Help in this Regards will be highly appreciated
-
After upgrading AS to run Webutil, Reports Server is no longer found
Recently we update de configuration of Application Server to use the WebUtil features (FileTransfer, etc) but some clients can not view the reports (the PDF files generated and the previous html page where are passed de parameters to generate de PDF file paramform=yes <--- I mean this parameteter passed to RUN_REPORT_OBJECT_PROC )
The curious thing is that in NetScape it Works fine, but in MS Internet Explorer does not.
Initially we thought that was the problem, a configuration in the client, but after formatting the PC, the problem persists.
In the webutils log (after enable this capabilitiy) does not show anything abnormal:
192.168.0.244:desarrollo: 2006-sep-27 12:19:46.967 WUT[setProperty()] Setting property WUC_SRV_LOGGING to 2
192.168.0.244:desarrollo: 2006-sep-27 12:19:46.967 WUT[setProperty()] Setting property WUC_GET_LOCAL_PROPERTY to syslib.jacob.dll
192.168.0.244:desarrollo: 2006-sep-27 12:19:46.967 WUT[getProperty()] Getting property WUC_GET_LOCAL_PROPERTY
192.168.0.244:desarrollo: 2006-sep-27 12:19:46.967 WUT[loadSettings()] Local properties file loaded
192.168.0.244:desarrollo: 2006-sep-27 12:19:47.248 WUT[setProperty()] Setting property WUC_GET_LOCAL_PROPERTY to syslib.JNIsharedstubs.dll
192.168.0.244:desarrollo: 2006-sep-27 12:19:47.248 WUT[getProperty()] Getting
In a similar topic we read that it could be a problem with the reports classpath, but why webutils configuration works in some clients and with others does not?
In the RUN_REPORT_OBJECT_PROC function instead using relative address for the reports servlet we changed for a complete adress, I mean
RUN_REPORT_OBJECT_PROC(repid,
'/reports/rwservlet')
replaced with:
RUN_REPORT_OBJECT_PROC(repid,
'http://ias.website/reports/rwservlet')
But the problem persists (we have the reports and forms services in the same server)
and after debugging the RUN_REPORT_OBJECT_PROC function, in this line
rep_status := report_object_status(report_message);
report_object_status returns null
Why happends this?
Could you help us? What information need to be posted to this? what else we need to do?
We configured webutils as mentioned in the Oracle® Forms Developer
WebUtil User’s Guide
Release 1.0.6
We're using MS Windows 2003 Server, Oracle AS 10g and Oracle DB 10g
The RUN_REPORT_OBJECT_PROC function (procedure) is the same what is mentioned in
http://www.oracle.com/technology/products/forms/pdf/10g/frmrepparamform.pdf
and the same that worked fine for a long time ago.We added the following lines to webutiljini.htm
For IE
<PARAM NAME="BROWSER" VALUE="InternetExplorer">
<PARAM NAME="MAYSCRIPT" VALUE="TRUE">
For NetScape:
BROWSER="Netscape"
MAYSCRIPT="true"
And adding the frmwebutil.jar to the Reports Server ClassPath the problem was solved -
Webutil download file from app server
i am calling a report from forms. report uses text_io to write delimited data to app server disk. report info also displays in browser using web.show_document. when i call report from forms i run report, use web.show_document to display in browser and then call webutil to download file to client form appserver. sequence would be in a manner as below:
run_report_object (report_id);
when report = finished then
web.show_document;
end if;
webutil.download_file (filename);
the problem is this: the web.show_document code runs but while this is running the webutil code also is running. but the report has not completed yet so when webutil runs looking for the file the report is supposed to write it cannot find it since the report has not completed. web.show_document fires off a browser session and then immediately runs the webutil code. but i dont want the webutil code to run until the report has successfully completed. does anyone know how to integrate these two functions into one step instead of running the report and allowing it to complete and then executing a separate step to download the file.
thank youYou might want to try this code snippet....
--- code to set parameters, declare variables etc...
l_report_return := run_report_object(l_report_id);
l_report_status := report_object_status(l_report_return);
WHILE l_report_status in ('RUNNING','OPENING_REPORT','ENQUEUED') LOOP
l_report_status := report_object_status(l_report_return);
END LOOP;
IF l_report_status = 'FINISHED' THEN
/*Display report in the browser*/
web.show_document(......);
ELSE
message('Error when running report ');
END IF; -
Run a report in Form10g using Application Server
I Installed Oracle Developer Suite and Oracle Business Intelligence Tools 10g (10.1.2.02).
I create a report City.jsp in Report Builder 10g.
I create a report object in Form10g. In dialog box I select use exiting file and browse the file CITY.JSP.
set property of report
and write following code in When-Button-Pressed trigger
DECLARE
repid REPORT_OBJECT;
v_rep VARCHAR2(100);
rep_status VARCHAR2(20);
BEGIN
repid := FIND_REPORT_OBJECT('CITY');
v_rep := RUN_REPORT_OBJECT(repid);
END;
No error, No output
What is I missing ?hi
try something like this.
DECLARE
repid REPORT_OBJECT;
v_rep VARCHAR2(100);
rep_status VARCHAR2(20);
plid ParamList;
vParamValue number;
BEGIN
plid := Get_parameter_List('tmp');
IF NOT Id_Null(plid) THEN
Destroy_parameter_List( plid );
END IF;
plid := Create_parameter_List('tmp');
add_parameter(plid,'p_parameter_name',text_parameter,to_char(:block.item));
Add_parameter(plid, 'PARAMFORM', TEXT_parameter, 'NO');
repid := FIND_REPORT_OBJECT('REPORT6');
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_COMM_MODE,SYNCHRONOUS);
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESTYPE,cache);
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESFORMAT,'PDF');
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER, 'paramform=no');
v_rep := RUN_REPORT_OBJECT(repid,plid);
rep_status := REPORT_OBJECT_STATUS(v_rep);
WHILE rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED')
LOOP
rep_status := report_object_status(v_rep);
END LOOP;
/*Display report in the browser*/
WEB.SHOW_DOCUMENT('http://machine name:port/reports/rwservlet/getjobid'||substr(v_rep,instr(v_rep,'_',-1)+1)||'?
'||'server=report_server_name&P_parameter_name='||:block.item||
'¶mform=no');
END; sarah -
Trying to makea report run when clicking a button on a form
I am trying to run a report by clicking a button on a form (Forms 9i)
I have modified the registry settings for FORMS90_PATH and REPORTS_PATH to include my development directory, and now at last the report is generating. However the command to display the form in a window is not doing anything at all - no error even. Can someone please help, the trigger code for my button is displayed below:
DECLARE
rep_result VARCHAR2(30);
BEGIN
SET_REPORT_OBJECT_PROPERTY('INVENTORY_REPORT', REPORT_FILENAME, :GLOBAL.project_path || 'Inventory.rdf');
SET_REPORT_OBJECT_PROPERTY('INVENTORY_REPORT', REPORT_DESNAME, :GLOBAL.project_path || 'Inventory.htm');
rep_result := RUN_REPORT_OBJECT('INVENTORY_REPORT');
--MESSAGE('Rep result: ' || rep_result);
WEB.SHOW_DOCUMENT('file:///' || :GLOBAL.project_path || 'Inventory.htm', '_blank');
--WEB.SHOW_DOCUMENT('file:///C:\Temp\Dev\Inventory.htm', '_blank');
END;
thx
adamHi,
may be this could be helpful for you:
You have to include the following code to execute a report:
repid REPORT_OBJECT;
v_rep VARCHAR2(100);
rep_status Varchar2(20);
BEGIN
repid := find_report_object(report_name);
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'paramform=no');
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_EXECUTION_MODE,BATCH);
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_COMM_MODE,SYNCHRONOUS);
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESTYPE,CACHE);
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESFORMAT,'pdf');
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_SERVER,report_server_name);
v_rep := RUN_REPORT_OBJECT(repid);
rep_status := report_object_status(v_rep);
WHILE rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED') LOOP
rep_status := report_object_status(v_rep);
END LOOP;
if rep_status = 'FINISHED' then
WEB.SHOW_DOCUMENT('/reports/rwservlet/getjobid'||substr(v_rep,instr(v_rep,'_',-1)+1)||'?'||'server=repserver90','_blank');
else
error report not exists
end if;
END;
Also you have to create the report server with the command:
"rwserver - install service_name autostart=yes
report server name must be the same that appears in the code above
You must add the report to run in the REPORT object type in your .fmb and put there with the same name
The report server to install ought to be the one and only in you network to avoid mistakes... -
Hi,
we have an application which uses webutil in some forms and 50 users in a lan with microsoft I.E. browser xp (patch 2 or 3) .
All the users when run url of forms without webutil have the same time to open the applications, instead when the forms use webutil 5 users have to wait long time before to access to the application (after all works fine and fast)
For others users (45) the time is the same.
Besides we install in one of these problematic client the developer suite to try the local A.S. and we wonder that the forms with webutil open quickly in local pc.
Therefore we have 50 clients and :
-- 50 clients open quickly the forms without webutil in the lan .
-- 45 clients open quickly also the forms with webutil in the lan
-- 5 clients open very slowly the forms with webutil in the lan (after they work fine) and they open quickly the same forms with webutil in local AS (devsuite) . They use I.E. 7 and have patch 3 of xp
We tried to disable antivirus,microsoft firewall but nothing has changed .
What could be the problem ?
GianpaoloThanks MIke for your feedback...
Will this surfice?
Procedure Test_Report Is
repid REPORT_OBJECT;
v_rep VARCHAR2(100);
rep_status VARCHAR2(50);
BEGIN
repid := find_report_object('report5');
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_EXECUTION_MODE,BATCH);
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_COMM_MODE,SYNCHRONOUS);
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESTYPE,CACHE);
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESFORMAT,'html');
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_SERVER,'repserver90');
SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'paramform=no pdeptno='||:dept.deptno);
v_rep := RUN_REPORT_OBJECT(repid);
rep_status := REPORT_OBJECT_STATUS(v_rep);
WHILE rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED')
LOOP
rep_status := report_object_status(v_rep);
END LOOP;
IF rep_status = 'FINISHED' THEN
/*Display report in the browser*/
WEB.SHOW_DOCUMENT('http://<YourServerName:8888/reports/rwservlet/getjobid'||
substr(v_rep,instr(v_rep,'_',-1)+1)||'?'||'server=repserver90','_blank');
ELSE
message('Error when running report');
END IF;
END;
Maybe you are looking for
-
How do I use AI Temperature with multiple thermocouple types?
Hi, I am trying to read temperatures from thermocouples. I have the PXI-1112 module. I have 3 thermocouple types. Is there a way to use the AI temperature VI to process all thermocouples with a single wire connection? The VI has an input for thermoco
-
Nesting a lightbox in a slideshow
Can I nest a fullscreen image (or lightbox) to be triggered by the individual images in a permanently visible composition widget slideshow? I've tried, and Adobe documentation infers that its possible, but I've had no luck with this so far. cheers, N
-
I'm looking to get a 42" television. My problem is, I still have a lot of standard def viewing that I will be doing. Does it make more sense for me to go Plasma or LCD? Is there a difference in regard to standard def? Would I be better of getting
-
ClassNotFoundException deserializing
I am having an strange problem: in a servlet, when I serialize and then deserialize it's session I happen to get: 1.- Serialization and Deserialization goes OK when session has no attributes; 2.- Serialization and Deserialization goes OK when session
-
Why would Safari's Web Cache be used by Other Third Party Browsers (Chrome, Opera, Camino) under OS X 10.6.8 (Safari 5.1), This is functionality that needs to be stripped from OS X or at least selectable so that it can be turned off for web design pr