Link to home
Start Free TrialLog in
Avatar of camposaa
camposaa

asked on

Upgrading Oracle Forms 6i to 10g

Upgraded Forms 6i to Forms 10g  (10.1.2.0.2)

I recently upgraded my application server to the 10g environment and recompiled all my forms, reports, libraries, menus, etc...The only problem I am receiving is with running reports from a form. The message was FRM-41842 : Run_Product(Reports) is no longer supported. Use Run_Report_Object instead.  Any ideas/workarounds for the code I included or will the whole procedure need to be re-written, any ideas?


PROCEDURE RUN_REPORTS(PL_REPORT_NAME VARCHAR2) IS 
alert_result number; 
param_list paramlist; 
param_list_name varchar2(12) := 'WHERE_PL'; 
lv_sqlerrm VARCHAR2(600); 
where_clause VARCHAR2(1000) := null; 
FILE_NAME varchar2(60); 
FILE_SEQ number; 
FILE_EXT varchar2(10) := 'pdf'; 
REPORT_NAME varchar2(60) := 'REPORT1'; 
v_forms60_output varchar2(60); 
v_forms60_mapping varchar2(60); 
 
BEGIN 
BEGIN 
select seq_report.nextval 
into FILE_SEQ 
from dual; 
END; 
 
tool_env.getvar('FORMS60_OUTPUT',v_forms60_output); 
tool_env.getvar('FORMS60_MAPPING',v_forms60_mapping); 
FILE_NAME := REPORT_NAME||'_'||FILE_SEQ||'.'||FILE_EXT; 
 
if :report1_vw.field1 is null then 
raise form_trigger_failure; 
end if; 
 
--make sure parameter list does not exist 
param_list := get_parameter_list(param_list_name); 
if not id_null(param_list) then 
destroy_parameter_list(param_list); 
end if; 
 
--create parameter list 
param_list := create_parameter_list(param_list_name); 
if id_null(param_list) then 
message('Cannot create parameter list'); 
raise form_trigger_failure; 
end if; 
 
add_parameter(param_list_name, 'PARAMFORM',text_parameter,'NO'); 
add_parameter(param_list_name, 'SALT',text_parameter, to_char(:report1_vw.field1)); 
add_parameter(param_list_name, 'INC',text_parameter,:report1_vw.field2); 
add_parameter(param_list_name, 'TCOM',text_parameter,:report1_vw.field3); 
add_parameter(param_list_name, 'DESFORMAT', text_parameter, 'PDF'); 
add_parameter(param_list_name, 'DESTYPE', text_parameter, 'FILE'); 
add_parameter(param_list_name, 'DESNAME', text_parameter, v_forms60_output||'\'||FILE_NAME); 
RUN_PRODUCT(REPORTS, PL_REPORT_NAME, SYNCHRONOUS, RUNTIME, FILESYSTEM, param_list_name, NULL); 
Web.Show_document(v_forms60_mapping||'/'||FILE_NAME, '_SELF'); 
END;

Open in new window

Avatar of Jinesh Kamdar
Jinesh Kamdar
Flag of India image

Did u try using the new method in the place of the old one? Did it work?
Avatar of sonicefu
Run_Product is no more supported to call reports in forms
You've to replace Run_Product with Run_Report_Object
As far as I know, some re-write is required.  You will have to change any calls to RUN_PRODUCT to RUN_RPORT_OBJECT instead.  And this may require a slightly different set of parameters.

If you have a large number of forms that do this, it may be worth investigating a third-party Forms upgrade product that can automate this for you.  The best producty for this that I know of is from a company in Ontario, Canada: Imex Systems.  See: www.imexsystems.com.

Our management chose to purchase Oracle Apps instead of upgrading our custom Forms6 app, so I never went through the Forms6 - Forms10 process myself.
report_id:=FIND_REPORT_OBJECT('repstartObj');



    * SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_COMM_MODE,SYNCHRONOUS);

    * SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_FILENAME,< Reports File Name>);

    * SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_SERVER,<Reports Server Name>);

    * SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_DESTYPE,<Destype e.g. Cache >);

    * SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_DESFORMAT,<Desformat, e.g. PDF>);


call RUN_REPORT_OBJECT(report_id) to execute the report on the server
Before starting migration you should change the following files, so that changes can reflect in all FMBs

<ORACLE_HOME>\forms\converter.properties
<ORACLE_HOME>\forms\search_replace.properties

The search_replace.properties file contains entries which will replace the older version to 10g equivalent.

For example:

Replace19=RUN_PRODUCT|RP2RRO.RP2RRO_RUN_PRODUCT

This will find RUN_PRODUCT and change it to RP2RRO.RP2RRO_RUN_PRODUCT. Users can add any strings to be find and replaced here using:

SEARCH_STRING|REPLACE_STRING

Then in the batch file we can compile all fmb files using this conversion mechanism
for more details abt Run_Report_Object , read the following

http://www.oracle.com/technology/products/forms/pdf/10g/frm10gsrw10g.pdf
Avatar of camposaa
camposaa

ASKER

I changed the code, now I'm getting this error now, any ideas?

FRM-40738 Argument 1 to builtin FIND_REPORT_OBJECT cannot be null

DECLARE
 
v_report_id Report_Object;
vc_ReportServerJob VARCHAR2(100);
vc_rep_status VARCHAR2(100);
vjob_id VARCHAR2(100);
vc_reportoj Varchar2(100);
vc_reportserver Varchar2(100);
vc_runformat varchar2(100);
 
 
	alert_result number;
	param_list   paramlist;
	param_list_name varchar2(12) := 'WHERE_PL';
	lv_sqlerrm VARCHAR2(600);
	where_clause VARCHAR2(1000) := null;
	FILE_NAME varchar2(60);
	FILE_SEQ number;
	FILE_EXT varchar2(10) := 'pdf';
	REPORT_NAME varchar2(60) := 'AIT_DATA_SHEET';
	v_forms60_output varchar2(60);
  v_forms60_mapping varchar2(60);
  
  BEGIN
  		BEGIN
				select seq_report.nextval
				into FILE_SEQ 
				from dual;
			END;
	
		tool_env.getvar('FORMS60_OUTPUT',v_forms60_output);
		tool_env.getvar('FORMS60_MAPPING',v_forms60_mapping);
 		FILE_NAME := REPORT_NAME||'_'||FILE_SEQ||'.'||FILE_EXT;
 		
 		 if :ait_alt_vw.shipalt is null then
	   	  raise form_trigger_failure;
 		 end if;
 		 
	   --make sure parameter list does not exist
	   param_list := get_parameter_list(param_list_name);
	   if not id_null(param_list) then
		    destroy_parameter_list(param_list);
	   end if;
	
	   --create parameter list
	   param_list := create_parameter_list(param_list_name);
	   if id_null(param_list) then
		   message('Cannot create parameter list');
	     raise form_trigger_failure;
	   end if;
	   
	   /*add_parameter(param_list_name, 'PARAMFORM',text_parameter,'NO');
	   add_parameter(param_list_name, 'SALT',text_parameter, to_char(:ait_alt_vw.shipalt));
	   add_parameter(param_list_name, 'INC',text_parameter,:ait_alt_vw.incr);
	   add_parameter(param_list_name, 'TCOM',text_parameter,:ait_alt_vw.tycom);
	   add_parameter(param_list_name, 'DESFORMAT', text_parameter, 'PDF');
		 add_parameter(param_list_name, 'DESTYPE', text_parameter, 'FILE');
		 add_parameter(param_list_name, 'DESNAME', text_parameter, v_forms60_output||'\'||FILE_NAME);*/
		 
		 v_report_id:= FIND_REPORT_OBJECT(vc_reportoj);
		 
		 SET_REPORT_OBJECT_PROPERTY(v_report_id,REPORT_COMM_MODE,SYNCHRONOUS);
     SET_REPORT_OBJECT_PROPERTY(v_report_id,REPORT_FILENAME,'AIT_DATA_SHEET');
     SET_REPORT_OBJECT_PROPERTY(v_report_id,REPORT_SERVER,'rep_AISCNTS15V_OAS10Gr2');
     SET_REPORT_OBJECT_PROPERTY(v_report_id,REPORT_DESTYPE,FILE);
     SET_REPORT_OBJECT_PROPERTY(v_report_id,REPORT_DESFORMAT,'PDF');
     --SET_REPORT_OBJECT_PROPERTY(v_report_id,REPORT_OTHER,SALT||:ait_alt_vw.shipalt||paramform=no);
     vc_ReportServerJob:=RUN_REPORT_OBJECT(v_report_id);
     vjob_id := substr(vc_ReportServerJob,length(vc_reportserver)+2,length(vc_ReportServerJob));
     vc_rep_status := REPORT_OBJECT_STATUS(vc_ReportServerJob);
     IF vc_rep_status = 'FINISHED' THEN	
     	Web.Show_document(v_forms60_mapping||'/'||FILE_NAME, '_SELF');
     	--WEB.SHOW_DOCUMENT (/reports/rwservlet/getjobid4|| vjob_id||?server=vc_reportserver,'_blank');
  		ELSE
			--message (Report failed with error message ||vc_rep_status);
			null;
END IF;
END;

Open in new window

v_report_id:= FIND_REPORT_OBJECT('vc_reportoj');
Added that piece, now I get FRM-41219:  Cannot find report: invalid ID.

My reports are the same directory as my forms
specify path
for example
repid := FIND_REPORT_OBJECT('C:\myFiles\repName');
Is it true that there is a BUG that won't allow for underscores in the name of the report server?  I keep running across documents saying to remove the underscore thats between the rep and the machine name...e.g. rep_REPSVR
I tried this and no go...

specify path
for example
repid := FIND_REPORT_OBJECT('C:\myFiles\repName');

I'm going through documentation to verify that my install and confiiguration is correct.
ASKER CERTIFIED SOLUTION
Avatar of sonicefu
sonicefu
Flag of Pakistan image

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
My reports run now but the report won't display on the screen after running it, it writes it to the hard drive in my \ORACLE_HOME\reports\cache directory...how do you show the pdf report in IE?
Thanks sonicefu
You can change the call to RP2RRO.RP2RRO_RUN_PRODUCT and attach the Oracle provided RP2RRO library.  You need to add a Report Object to the calling from.  This is what we do when we (www.pitssamerica.com) convert, migrate or upgrade any version of Oracle Forms and Reports to 10g.

There is one other issue you might run into.  If you use the Report parameter form, you need to make some more changes.  We have a solution for that as well, but it is better to handle these with an automated tool like PITSS.con.