Skip to Main Content

Oracle Forms

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Report 12c - Parameter

SANPATAug 20 2016 — edited Aug 22 2016

Hi Friends

I want to run the report based on Month and year . Report should select only those data which are matching with Month and Year Fields.

In D2k 6i reports, all these parameters are been defined in report level itself ,

12c report its been defined but when we run from report builder there it shows the parameter screen but when we run from form its not visiable directly it takes to pdf.

.rep12c.jpg

declare
xpath varchar2(45);
PARALIST paramlist;
rep_id report_object;
v_rep varchar2(100);
v_report_server varchar2(100);
v_servlet_url varchar2(500);
v_job_id varchar2(100);
rep_status varchar2(100);
P_FILE_NAME varchar2(100);
begin
P_FILE_NAME:='C:\erp\'||'attendence.PDF';
xpath:='C:\erp\hr\attendencelist.rdf';

PARALIST := Get_Parameter_List('param_list_main');
IF id_null(paralist) THEN
PARALIST := CREATE_PARAMETER_LIST('param_list_main');
ELSE
Destroy_Parameter_List(paralist);
PARALIST := CREATE_PARAMETER_LIST('param_list_main');
END IF;
ADD_PARAMETER(PARALIST,'Month',TEXT_PARAMETER,:block3.month);
ADD_PARAMETER(PARALIST,'Year',TEXT_PARAMETER,:block3.Year);

v_report_server := 'rep_wls_reports_sanjay';
v_servlet_url := 'sanjay:9002/reports/rwservlet';

rep_id:=find_report_object('Report5');

set_report_object_property(rep_id,REPORT_SERVER,v_report_server);
set_report_object_property(rep_id,REPORT_EXECUTION_MODE,BATCH);
set_report_object_property(rep_id,REPORT_COMM_MODE,SYNCHRONOUS);
set_report_object_property(rep_id,REPORT_DESTYPE,FILE);
set_report_object_property(rep_id,REPORT_DESFORMAT,'PDF');
set_report_object_property(rep_id,REPORT_FILENAME,xpath); --Your reports file name with path goes here like you have xpath:=xpath||'PrintTran.rep'
set_report_object_property(rep_id,REPORT_DESNAME,P_FILE_NAME); --Your generated file name give appropriate file name according to yours.
v_rep:=run_report_object(rep_id,PARALIST);
--v_rep:=run_report_object(rep_id);-->This is for non-parameterised report.
rep_status := REPORT_OBJECT_STATUS(v_rep);
Message(rep_status);
Message(rep_status);

V\_JOB\_ID := SUBSTR(V\_REP,INSTR(V\_REP,'\_',-1)+1);  
 
IF rep\_status = 'FINISHED' THEN  
   web.show\_document('[http://'||v\_servlet\_url||'/getjobid'||V\_JOB\_ID,'\_blank');](http://'||v_servlet_url||'/getjobid'||V_JOB_ID,'_blank');)  
END IF;  

exception when no_data_found then
null;
end;

This post has been answered by Andreas Weiden on Aug 21 2016
Jump to Answer

Comments

Processing
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Sep 19 2016
Added on Aug 20 2016
17 comments
2,377 views