Hi to all respected Gurus!
I have just migrated an application from Oracle Forms6i to Oracle Developer 10g. Forms are working fine but I am facing problem when call a report from FORM. Report has two paramters i.e. Start Date and End Date. And I am getting below error.
Terminated with error: <br>REP-546: Value does not match mask 'DD-MON-RRRR'. ORA-01830: date format picture ends before converting entire input string REP-0091: Invalid value for parameter 'D1'.
What I did is as under:-
Created a PROCEDURE in Oracle Forms as under:
PROCEDURE run_report_object_proc (
report_id report_object,
report_server_name VARCHAR2,
report_format VARCHAR2,
report_file_name VARCHAR2,
report_otherparam VARCHAR2,
reports_servlet VARCHAR2)
IS
report_message VARCHAR2 (1000) := '';
rep_status VARCHAR2 (1000) := '';
vjob_id VARCHAR2 (4000) := '';
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, CACHE);
SET_REPORT_OBJECT_PROPERTY (report_id, report_desformat, report_format);
SET_REPORT_OBJECT_PROPERTY (report_id, report_other, 'paramform=no '||report_otherparam);
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
message ('Report failed with error message '||rep_status);
END IF;
END;
------
Created a Button on Form and written below code on the button
:global.reportserver:='rep_misappsrv';
declare
report_id report_object := find_report_object('report');
v_report_other varchar2(4000);
reports_servlet VARCHAR2(1000) := '/reports/rwservlet';
begin
v_report_other := 'D1='|| TO_CHAR(:BLOCK3.START_DATE,'DD-MON-RRRR')||'D2='||TO_CHAR(:BLOCK3.END_DATE,'DD-MON-RRRR');
run_report_object_proc(report_id, :global.reportserver, 'pdf', 'FMC_CAFE_REC_DETAIL.rdf', v_report_other,reports_servlet);
end;
-----
Placed this code in PRE-FORM trigger.
:global.reportserver:='rep_misappsrv';
----
I tried many ways like to_DATE(:BLOCK3.START_DATE,'DD-MON-RRRR') but not worked.
Please note:-
1. that D1 and D2 are my report parameters taking input as Start Date and End Date from end-user.
2. My Report Server name = rep_misappsrv
Thanks for your guidance and help.