Thursday, June 11, 2020

oracle 12c report run on url parameters

PROCEDURE PRINT_PROC_url IS

v_rep               VARCHAR2(1000);
rep_url varchar2(2000);
v_Params varchar2(2000);
v_Params1 varchar2(2000);
v_userid       varchar2(1000):='jayson/jsn@orcl';
v_host         varchar2(1000):='localhost:9002';  --:global.IP;
v_path_int     varchar2(1000):='E:\JAYSON\'; --:GLOBAL.MENU_PATH;
v_path         varchar2(1000);
v_desformat    varchar2(1000);
BEGIN

v_desformat:='pdf';  --spreadsheet

v_Params:= '&P_DT1='||:JNPBD_STN_MAST.DT1
||'&P_DT2='||:JNPBD_STN_MAST.DT2
   ||'&P_PRODUCT_CD='||:JNPBD_STN_MAST.PRODUCT_CD
   ||'&P_ITEM_CD='||:JNPBD_STN_MAST.ITEM_CD;

 
 
        if :JNPBD_STN_MAST.REPOT_LIST=1 then
        v_path:=''||v_path_int||'JNPBD\Reports\jnpbd_list_of_mps.rdf';
        elsif :REPOT_LIST=2 then                             
        v_path:=''||v_path_int||'JNPBD\Reports\jnpbd_list_of_wbs.rdf';
   
        elsif :REPOT_LIST=3 then
        v_path:=''||v_path_int||'JNPBD\Reports\jnpbd_material_used_for_product.rdf';
   
        elsif :REPOT_LIST=4 then
        v_path:=''||v_path_int||'JNPBD\Reports\jnpbd_list_of_mfg_bd_dt.rdf';
 
        elsif :REPOT_LIST=5 then
        v_path:=''||v_path_int||'JNPBD\Reports\jnpbd_list_of_mfg_bd_dt_code.rdf';
   
        elsif :REPOT_LIST=6 then
        v_path:=''||v_path_int||'JNPBD\Reports\jnpbd_list_of_mfg_bd_dt_name.rdf';
 
        elsif :REPOT_LIST=7 then
        v_path:=''||v_path_int||'JNPBD\Reports\jnpbd_list_of_mfg_comp_uncomp.rdf';
   
        elsif :REPOT_LIST=8 then
        v_path:=''||v_path_int||'JNPBD\Reports\jnpbd_charge_recons1.rdf';
 
        elsif :REPOT_LIST=9 then
        v_path:=''||v_path_int||'JNPBD\Reports\jnpbd_list_of_product.rdf';
   
        elsif :REPOT_LIST=10 then
        v_path:=''||v_path_int||'JNPBD\Reports\jnpbd_list_of_item.rdf';
 
        elsif :REPOT_LIST=11 then
        v_path:=''||v_path_int||'JNPBD\Reports\jnpbd_Product_group_list.rdf';
 
        elsif :REPOT_LIST=12 then
        v_path:=''||v_path_int||'JNPBD\Reports\jnpbd_material_type_list.rdf';
   
        elsif :REPOT_LIST=13 then
        v_path:=''||v_path_int||'JNPBD\Reports\jnpbd_material_group_list.rdf';
 
        elsif :REPOT_LIST=14 then
        v_path:=''||v_path_int||'JNPBD\Reports\jnpbd_sbd_list.rdf';
   
        elsif :REPOT_LIST=15 then
        v_path:=''||v_path_int||'JNPBD\Reports\jnpbd_charge_cal_list.rdf';
 
      end if;


rep_url:='http://'||v_host||'/reports/rwservlet?userid='||v_userid||'&report='||v_path||''
||'&desformat='||v_desformat||'&destype=cache'
||''||v_Params||'&paramform=no';

/*

rep_url:='http://'||v_host||'/reports/rwservlet?userid='||v_userid||'&report='||v_path||''
||'&desformat='||v_desformat||'&destype=cache'||''||v_Params||'&paramform=no';

--ok above
rep_url:='http://'||v_host||'/reports/rwservlet?userid='||v_userid||'&report='||v_path||''
||'&desformat='||v_desformat||'&destype=cache'
||'&v_Params&paramform=no';

rep_url:='http://'||v_host||'/reports/rwservlet?userid='||v_userid||'&report='||v_path||''
||'&desformat='||v_desformat||'&destype=cache'
||'&v_Params&paramform=no';
*/


WEB.SHOW_DOCUMENT(rep_url,'_blank');


EXCEPTION

    WHEN OTHERS THEN
   
    MESSAGE('Error, Contact your administrator');
   
END;

No comments:

Post a Comment

To generate a PDF using JavaScript in Oracle APEX from a collection

  To generate a PDF using JavaScript in Oracle APEX from a collection, you can follow these steps: 1. Create a button or link on your APEX p...