Skip to Main Content

Oracle Forms

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Help calling a report with spreadsheet output in forms 11.1

KlausMogensenMay 5 2014 — edited May 5 2014

Hello

I'm currently calling reports 11 from forms 11 with DESFORMAT "pdf" as shown below, and it works fine:

report := Find_Report_Object(p_report_navn);

   Set_Report_Object_Property(v_report, report_execution_mode, batch);

   Set_Report_Object_Property(v_report, report_comm_mode, synchronous);

   Set_Report_Object_Property(v_report, report_destype, CACHE);

   SET_REPORT_OBJECT_PROPERTY(v_report, REPORT_FILENAME, '<reportfile>');

   Set_Report_Object_Property(v_report, report_desformat, 'pdf'); 

   SET_REPORT_OBJECT_PROPERTY( v_report, REPORT_SERVER, '<servername>');

   v_rep_rtn := Run_Report_Object(v_report, p_paramlist);

     if (v_rep_rtn IS NOT NULL) then

    rep_status := Report_Object_Status(v_rep_rtn);

    WHILE ( rep_status IN ('RUNNING','OPENING_REPORT','ENQUEUED') ) LOOP

       rep_status := Report_Object_Status(v_rep_rtn);

    END LOOP;

    IF ( rep_status = 'FINISHED' ) THEN

       Web.Show_Document(konstanter.webrepurl||'/getjobid'||substr(v_rep_rtn, INSTR(v_rep_rtn,'_',-1) +1)||'?server='||'<servername>);

    ELSE

      message(Error: '||dbms_error_text||', rep_status: '||rep_status||', SQL err: '||SQLERRM||', v_rep_rtn: '||v_rep_rtn);

    END IF;

  else

    message('Error');

   end if;

Now I need it to output to a spreadsheet (Excel) and have it open in the browser or let the user download it

So I simply change Set_Report_Object_Property(v_report, report_desformat, 'pdf');  to Set_Report_Object_Property(v_report, report_desformat, 'SPREADSHEET'); 

The file that gets's generated does indeed hold a spreadsheet, but the browser doesn't know, since the file has no extention on it - so the browser simply lets me save it and, then I need to rename it or open it manually, because my PC won't know how to handle the file either.

It's the same for IE, Chrome and Firefox. Normally they open excel files just fine

How do I fix this?

Best regards

Klaus Mogensen

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 2 2014
Added on May 5 2014
4 comments
3,271 views