English 中文(简体)
How do we export a ms-word (or rtf) document (from a web browser) to generated by pl/sql?
原标题:

I need to generate a ms-word document from a pl/sql query to export a set of reports through a web browser.

I have been searching for a specific way to modify the content headers using owa_util.mime_header etc etc but could not really get a working proof of concept to get the web page to present the user to download/open/save a ms-word document.

I know it s not much but..

   begin
    OWA_UTIL.MIME_HEADER (  application/vnd.ms-word , false);
    htp.print( Content-Disposition:attachment;filename="test.doc" );
    OWA_UTIL.HTTP_HEADER_CLOSE;
        for x in (select first_column, second_column from my_table)
            loop
                htp.p(x.first_column|| <br/> ||x.second_column|| <br/><br/> );
            end loop;
    end;

Could someone please shed some light on how can I create a procedure that generates output to html which intercept the browser headers and prints out the query content to a word document?

By the way, the current environment (restriction) I am running this from: Oracle APEX 3.0.1 (not 3.1, which I believe has an export to word doc feature).

Thanks in advance.

最佳回答

In Apex you can make a page that is completely generated from a procedure of your making:

  1. Create a blank page.
  2. Under Processes, click Create, and choose PL/SQL.
  3. Give it a name, and leave the default option "On Load - Before Header".
  4. For PL/SQL Page Process, enter the following:

    BEGIN
       myprocedure;
       htmldb_application.g_unrecoverable_error := true;
    END;
    
  5. Create your procedure (the code you have should work ok) and it should work fine.

EDIT: the code in "myprocedure" should emit HTML code, including the HTML and BODY tags.

问题回答

暂无回答




相关问题
WORD 2007 w/VBA

I have a question regarding a WORD 2007 form used to gather information from users. I had it working in WORD 2003 then pulled it over into WORD 2007 and got it working but couldn t leave well enough ...

Word opens extra blank document

I have an issue on a client machine that seems to be interferring with a word addin that ive built. When any word document opens on the client machine, a second blank document opens also. Ive seen ...

MS Word splits words in its XML format

I have a Word 2003 document saved as a XML in WordProcessingML format. It contains few placeholders which will be dynamically replaced by an appropriate content. But, the problem is that Word ...

Creating & Editing MS-Word documents on a linux server?

Looking to develop server-side application that will process documents. The source documents are mostly MS-Word 2003, 2007, i.e. the MS version of Docx. Want the server application to be able to run ...

Word document printed on MS Access report using OLE object

For years, we have been printing Word 2003 documents that have been saved to a OLE object column using an access report. We are using Access 2003. For some reason when we copy a Word 2003 document ...

热门标签