Home » Developer & Programmer » Forms » error in calling reports
error in calling reports [message #459494] Sun, 06 June 2010 03:35 Go to next message
mahajneh
Messages: 16
Registered: May 2010
Junior Member
hello everybody

i have written the following code to run a report from a form
but the result is differ as follow:

1- when the report server is 'repserver10' every thing goes well
2- when the report server is 'bethserver' it will not work

code:::::

DECLARE
		
        CURSOR GET_INSTANCE_NAME1 IS// [color=red]this cursor to return the name of database connected to[/color]
	SELECT UPPER(INSTANCE_NAME)
	FROM V$INSTANCE;
SH_INSTANCE_NAME VARCHAR2(15);

	repid 			report_object;
	v_rep 			varchar2(100);
	rep_status 	        varchar2(20);
	rep_name                varchar2(100);
	REP_SERVER	        VARCHAR2(100);
	LIST_ID PARAMLIST;
	

BEGIN
	OPEN	CHK_PKG;
	FETCH	CHK_PKG INTO XCNT_NO;
	CLOSE	CHK_PKG;
	IF XCNT_NO > 1 THEN
		SHOW_STD_ALERT(586,'STOP',:GLOBAL.USER_LANG);
	END IF;
	

        OPEN	GET_INSTANCE_NAME1 ;
	FETCH	GET_INSTANCE_NAME1 INTO SH_INSTANCE_NAME;
	CLOSE	GET_INSTANCE_NAME1 ;
	message(SH_INSTANCE_NAME);

	IF SH_INSTANCE_NAME ='NICMAIN' THEN
		REP_SERVER := 'REPSERVER10';
	ELSIF SH_INSTANCE_NAME ='NICBETH1' THEN
		REP_SERVER := 'BETHSERVER';
	END IF;

message(REP_SERVER);

LIST_ID  := GET_PARAMETER_LIST('TMPDATA');
IF NOT ID_NULL(LIST_ID) THEN
      DESTROY_PARAMETER_LIST(LIST_ID);
END IF;

LIST_ID  := CREATE_PARAMETER_LIST('input_param');
		ADD_PARAMETER(LIST_ID, 'FBRANCH', TEXT_PARAMETER, TO_CHAR(:BLK1.HEC_BRANCH));
		ADD_PARAMETER(LIST_ID, 'TBRANCH', TEXT_PARAMETER, TO_CHAR(:BLK1.HEC_BRANCH));
		ADD_PARAMETER(LIST_ID, 'FOFFICE', TEXT_PARAMETER, TO_CHAR(:BLK1.HEC_OFFICE));
		ADD_PARAMETER(LIST_ID, 'TOFFICE', TEXT_PARAMETER, TO_CHAR(:BLK1.HEC_OFFICE));
		
		
		
repid := find_report_object('Acrep30A');
set_report_object_property(repid,report_execution_mode,runtime);
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,REP_SERVER);

message('1');

v_rep := RUN_REPORT_OBJECT(repid,LIST_ID);

message('2');

message(v_rep);

rep_status := REPORT_OBJECT_STATUS(v_rep);

message(REP_STATUS);

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
('http://office_server:8889/reports/rwservlet/getjobid'||substr(v_rep,instr(v_rep,'_',-1)+1)||'?'||'server='||REP_SERVER,'_blank');
ELSE
message('Error when running report');
END IF;
synchronize;
destroy_parameter_list(list_id); 
END;


I use 2 report servers according to the database connected to as you see, but when the report server is 'bethserver'
this code print out the message('1') before v_rep=run_report_...
and then the program stop working

any ideas plz???
what i can do to know where is the error???

[Updated on: Sun, 06 June 2010 03:38]

Report message to a moderator

Re: error in calling reports [message #459520 is a reply to message #459494] Sun, 06 June 2010 09:41 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
What is the difference between BETHSERVER from REPSERVER10? Make them equal! (Possibly, make "bethserver" work, instead of making "repserver10" not work).
Re: error in calling reports [message #463897 is a reply to message #459520] Mon, 05 July 2010 02:13 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Sorry that I have been so long in replying. Have you solved your problem?

Lose all the loop code and just use the 'web.show_document'.

David
Previous Topic: TNS No Such Protocol adaptor Ora- 12222 and Unable to connect oracle :( (merged)
Next Topic: navigating using images
Goto Forum:
  


Current Time: Fri Sep 20 03:45:14 CDT 2024