Home » Developer & Programmer » Forms » run report in Web Layout from Forms
run report in Web Layout from Forms [message #409431] Mon, 22 June 2009 12:00 Go to next message
Roger22
Messages: 98
Registered: April 2009
Location: Brasov, ROMANIA
Member
Hello,
i have the following code in a when-button-pressed
DECLARE 
report_id REPORT_OBJECT; 
report_job_id VARCHAR2(200); 
rep_status VARCHAR2(200); 
JOB_NUMBER number; 
server_name VARCHAR2(200) := 'roger'; 
rep_url varchar2(500);
 
BEGIN 
 
/* Check to see if forms application is WEB deployed */ 
 
IF get_application_property(user_interface) = 'WEB' THEN 
	
	report_id:= FIND_REPORT_OBJECT('report107'); 
	 
	/* Set Report parameters given WEB deployment */ 
	SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_SERVER , server_name); 
	SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_DESTYPE,CACHE); 
	 
	/* DESFORMAT could be HTML, HTMLCSS or PDF here*/ 
	SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_DESFORMAT,'HTML'); 
	 
	/* Run the report */ 
	report_job_id := RUN_REPORT_OBJECT(report_id); 
	 
	/* Check the report status */ 
	rep_status:=REPORT_OBJECT_STATUS(report_job_id); 
	
	WHILE rep_status IN ('RUNNING','OPENING_REPORT','ENQUEUED') 
	LOOP 
	rep_status := report_object_status(report_job_id); 
	END LOOP; 
	
	IF rep_status='FINISHED' THEN 
	message('REPORT WAS CORRECTLY RUN'); 
	 
	/* Display the report output in the client browser */ 
	JOB_NUMBER := length(server_name) + 2; 
	rep_url:='/reports/rwservlet?report=D:\Oracle\product\10.2.0\DevSuiteHome_1\reports\ORAR.jsp'
     ||'&userid='||get_application_property(username)
     ||'/'||get_application_property(password)
     ||'@'||get_application_property(connect_string)
     ||'&desformat=htmlcss'
     ||'&destype=cache'
     ||'&paramform=yes'
     ||'&getjobid'||substr(report_job_id,JOB_NUMBER)
     ||'&param_cls='||to_char(:control.lst_clase)
     ||'&param_ansc='||to_char(:control.lst_an)
     ||'&param_sem='||to_char(:control.text_item26);

	WEB.SHOW_DOCUMENT (rep_url,'_blank');

	/* If report has failed display message to user */ 
	ELSE 
		message('REPORT FAILED WITH STATUS: '||rep_status, no_acknowledge); 
	END IF; 
	
ELSE 
 
	/* Else if forms application is Client-Server deployed */ 
	/* Set Report parameters given Client-Server deployment */ 
	 
	report_id:= FIND_REPORT_OBJECT('report107'); 
	SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_SERVER ,''); 
	 
	/* Report to be executed via Reports Background Engine, not the 'new' Reports Multi-Tier Server */ 
	/* Destype SCREEN or PREVIEW can be used here */ 
	 
	SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_DESTYPE,SCREEN); 
	 
	/* Run the report */ 
	 
	report_job_id := RUN_REPORT_OBJECT(report_id); 
	 
END IF; 
END;

but that report is running in paper layout (i run that report first from Reports, there are two buttons: Paper Layout and Web Layout). from Forms, when the report is opening, it's displayed in paper layout, but i wanna display in web layout. how can i do this?

Regards,
[EDITED by DJM: split too long line]

[Updated on: Tue, 23 June 2009 01:31] by Moderator

Report message to a moderator

Re: run report in Web Layout from Forms [message #409540 is a reply to message #409431] Tue, 23 June 2009 01:30 Go to previous message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Search this forum for 'web.show_document'. See how other people are running their reports. Lose the 'rep_status' and 'run_report_object' crap. Just run 'web.show_document'.

David
Previous Topic: save pdf thru form
Next Topic: Displaying total number of distinct records in forms 10g datablock
Goto Forum:
  


Current Time: Fri Dec 09 00:12:33 CST 2016

Total time taken to generate the page: 0.05769 seconds