6 Replies Latest reply on May 24, 2019 6:19 AM by Matthew D.

    Reports 12c - Export to excel

    SPathak

      Hi Friends

      Below is a codes which are written for data to export in excel , but i am unable to export it create a getjobid17 file, which i always need to convert to excel.

      Please suggest how to directly export to excel format.

       

      sanjay

        • 1. Re: Reports 12c - Export to excel
          SPathak

          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\'||'rackmaster.xls';

            xpath:='C:\erp\stores\rackmaster.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,'DOC_NO',TEXT_PARAMETER,:BANK_RECEIPT_H.doc_no);

          --ADD_PARAMETER(PARALIST,'year1',TEXT_PARAMETER,:block3.year1);

           

           

            v_report_server := 'rep_wls_reports_erp';

              v_servlet_url   := 'erp: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');

              -- export to excel

              set_report_object_property(rep_id,REPORT_DESFORMAT,'ENHANCEDSPREADSHEET');

              set_report_object_property(rep_id,REPORT_FILENAME,xpath);      

              set_report_object_property(rep_id,REPORT_DESNAME,P_FILE_NAME); 

              ---v_rep:=run_report_object(rep_id,PARALIST);

              v_rep:=run_report_object(rep_id);

              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');

              END IF;

            

          exception when no_data_found then

          null;

          end;

          • 2. Re: Reports 12c - Export to excel
            Frank Hoffmann

            Spathak,

             

            I am not familiar with desformat='EnhancedSpreadsheet' - I would try

            "DELIMITED" or just "SPREADSHEET" for a EXCEL Output from Reports.

             

            The CSV File should start Excel if it is installed on your Client from your browser.

             

            Frank

            • 3. Re: Reports 12c - Export to excel
              SPathak

              dear Frank

              I changed to spreadsheet even its not working . my written code is correct ?

              sanjay

              • 4. Re: Reports 12c - Export to excel
                Frank Hoffmann

                Are you sure you can call the Report without any parameters?

                 

                Is your Report Job processed succesful? I would guess you create an empty page.

                 

                Can you check the Reports Job Information? And if the Reportserver is running?

                 

                http://erp:9002/reports/rwservlet/showjobs?server=rep_wls_reports_erp

                http://erp:9002/reports/rwservlet/showenv?server=rep_wls_reports_erp

                 

                Frank

                • 5. Re: Reports 12c - Export to excel
                  SPathak

                  dear frank

                  report server is running , even i can get the report into pdf. but when i try to export to excel it generates the file name as getjobid20, its not directly converting to excel.

                  sanjay

                  • 6. Re: Reports 12c - Export to excel
                    Matthew D.

                    Try to change URL to look like this:

                     

                    http://....getjobid20&mimetype=application/msexcel

                     

                    Regards