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.
.
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;