0

want to run oracle 12 c report in excel

i want to run oracle 12 c report to excel,but not finding the way,i have posted code below please help me


Declare
   pl_id paramlist;
   v_rep_server varchar2(100);
 v_path varchar2(100);

 v_rep varchar2(100);

begin

 v_rep := 'SAMPLE_DETAIL_f.rdf';

 v_rep_server := pckg_erp.f_get_report_server_name(NULL,'192.168.0.231',null,null,null);
 v_path := pckg_erp.f_get_object_path(NULL ,v_rep,'R',null,35,'192.168.0.231',null,null,null); 

 WEB_REPORT.SETREPORTSSERVER(v_rep_server);
   WEB_REPORT.setDesformat('xls');

   pl_id:=get_parameter_list('temp');

   if not id_null(pl_id) then
       destroy_parameter_list(pl_id);
   end if;

   pl_id := Create_Parameter_List('temp'); 

   add_parameter(pl_id,'PARAMFORM',text_parameter,'NO');
   add_parameter (pl_id,'DESTYPE',TEXT_PARAMETER,'LOCALFILE');
   add_parameter (pl_id,'DESFORMAT',TEXT_PARAMETER,'ENHANSEDSPREADSHEET');
   add_parameter(pl_id,'MAXIMIZE',text_parameter,'YES');   
WEB_REPORT.RUN_REPORT(reports,v_path||v_rep,synchronous,runtime,filesystem,pl_id,null);

end;

  • Possible duplicate of [Create an Excel File (.xlsx) using PL/SQL](https://stackoverflow.com/questions/41299024/create-an-excel-file-xlsx-using-pl-sql) – William Robertson Oct 26 '19 at 08:24
  • 1
    What are `web_report`, `pckg_erp`, `destroy_parameter_list` etc? I've never heard of them. Do you need to use those, or Oracle Reports (which is tagged), or a generic PL/SQL solution, or else have Excel connect to the database and call a query? – William Robertson Oct 26 '19 at 08:28
  • @WilliamRobertson I believe this is a code from Oracle Forms, they are all packages I assume, built in or self created, that he uses... – VBoka Oct 26 '19 at 08:48
  • web_report, pckg_erp, destroy_parameter_list these are packages used in software – Muhammad Saqib Oct 26 '19 at 09:03
  • @WilliamRobertson i want to show report in excel format instead of pdf – Muhammad Saqib Oct 26 '19 at 09:06
  • PROCEDURE setDesformat (vDesformat varchar2)IS BEGIN if (upper(vDesformat) in ('HTML','HTMLCSS','PDF','XML','DELIMITED','RTF','ASCII','PS','PCL','XLS','XLSX','CSV')) then rp2rroDesformat := vDesformat; else message(vDesformat ||'is not a valid desformat'); end if; END; PROCEDURE FOR DESTINATION FORMAT – Muhammad Saqib Oct 26 '19 at 09:17
  • 1
    I'm pretty much sure that this is misspelled: ENHANSEDSPREADSHEET. Shouldn't that be ENHAN**C**ED ...? – Littlefoot Oct 26 '19 at 14:39
  • 1
    @MuhammadSaqib I can see they are packages/procedures. I was wondering more what they were doing in your sample code, since we can’t see them. Are they not working? – William Robertson Oct 28 '19 at 09:04
  • @Littlefoot yes ENHANCED was misspelled but still not working i have corrected the mistake – Muhammad Saqib Oct 28 '19 at 09:37

0 Answers0