1 Reply Latest reply: Mar 21, 2013 11:13 AM by jgarry RSS

    run report in excel

    962178
      hi i new to oracle

      if any thing i made mistake in posts correct me

      i want get my output in excel by calling report from form

      when i run get unable to run report

      PROCEDURE excel IS

      repid REPORT_OBJECT;
      v_rep VARCHAR2(100);
      rep_status VARCHAR2(20);
      BEGIN
      repid := find_report_object('report7');
      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,'SPREADSHEET'); -- PDF, HTMLCSS ...
      SET_REPORT_OBJECT_PROPERTY(repid,REPORT_SERVER,'repserver10');
      SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'paramform=no FROMDATE='||:excel.fromdate||'MYEAR'||to_char(:excel.myear,'dd/mm/yyyy')||'TODATE'||:excel.todate);
      v_rep := RUN_REPORT_OBJECT(repid);
      rep_status := REPORT_OBJECT_STATUS(v_rep);
      WHILE rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED')
      LOOP
      rep_status := report_object_status(v_rep);
      END LOOP;
      IF rep_status = 'FINISHED' THEN
      /* Display report in the browser */
      WEB.SHOW_DOCUMENT('http://systemnew:8889/reports/rwservlet/getjobid'||
      substr(v_rep,instr(v_rep,'_',-1)+1)||'?'||'server=repserver10','_blank');
      ELSE
      message('Error when running report');
      END IF;
      END;

      regards

      vasa