1 Reply Latest reply: Dec 19, 2012 6:27 AM by sanjay kumar roy RSS

    about forms 10g for calling report

    sanjay kumar roy
      Dear Sir ,

      I have create a procedure to call reports . i have given 2 parameters , 1 parameter is date another parameter is a 'where condition'. but i run the form it will not call the report because
      space is not allow in where condition , but you know if i replace the space by _ then it would not be meaning full , please suggest me.

      procedure
      --==========

      PROCEDURE run_report(mperiod char,pmwhere char)
      IS
      repid report_object;
      v_rep VARCHAR2 (100);
      rep_stat VARCHAR2 (40);
      compname VARCHAR2(100):='Alltex Industries Ltd.';
      CADDR VARCHAR2(100):='Ariabo, Rupgonj, Narayanganj';
      v_compname VARCHAR2 (100);
      v_CADDR VARCHAR2 (100);
      V_pmwhere VARCHAR2(100);



      BEGIN
      SELECT REPLACE (compname, ' ', '_')
      INTO v_compname
      FROM DUAL;

      SELECT REPLACE (CADDR, ' ', '_')
      INTO v_CADDR
      FROM DUAL;



      repid := FIND_REPORT_OBJECT ('ATTENDANCE_INOUTTIME_IKEA_C');
      SET_REPORT_OBJECT_PROPERTY (repid, report_execution_mode, batch);
      SET_REPORT_OBJECT_PROPERTY (repid, report_comm_mode, synchronous);
      SET_REPORT_OBJECT_PROPERTY (repid, report_destype, CACHE);
      SET_REPORT_OBJECT_PROPERTY (repid, report_desformat, 'pdf');
      SET_REPORT_OBJECT_PROPERTY (repid, report_server, 'rep_server');
      -- SET_REPORT_OBJECT_PROPERTY (repid, report_server, 'rep_apps1_asbiforms');




      SET_REPORT_OBJECT_PROPERTY (repid,
      report_other,
      ' MPERIOD='
      || mperiod
      ||' CADDR='
      || V_CADDR
      || ' PMWHERE='
      || pmwhere
      -- ||
      ||' paramform=yes'
      );



      v_rep := RUN_REPORT_OBJECT (repid); ----- Check status
      rep_stat := REPORT_OBJECT_STATUS (v_rep);

      WHILE rep_stat <> 'FINISHED'
      LOOP
      rep_stat := REPORT_OBJECT_STATUS (v_rep);
      END LOOP;

      --- end Check status
      -- WEB.SHOW_DOCUMENT('http://apps1.sfdw.org:7779/reports/rwservlet/getjobid'||substr(v_rep,instr(v_rep,'_',-1)+1)||'?'||'server=rep_apps1_asbiforms','_blank');
      web.show_document ( 'http://localhost:8889/reports/rwservlet/getjobid'
      || SUBSTR (v_rep, INSTR (v_rep, '_', -1) + 1)
      || '?'
      || 'server=rep_server',
      '_blank'
      );

      END;