我们如何导出 ms-word(或 rtf)文档(从网络浏览器)以由 pl/sql 生成?
我需要从 pl/sql 查询生成一个 ms-word 文档,以通过 Web 浏览器导出一组报告。
我一直在寻找一种使用 owa_util.mime_header 等修改内容标题的特定方法,但无法真正获得有效的概念证明来让网页向用户展示下载/打开/保存 ms-word 文档。
我知道这并不多,但是..
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;
有人可以解释一下如何创建一个生成 html 输出的程序,该程序拦截浏览器标头并将查询内容打印到 word 文档中吗?
顺便说一句,我正在运行的当前环境(限制): Oracle APEX 3.0.1(不是 3.1,我相信 3.1 具有导出到 Word 文档的功能)。
提前致谢。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 Apex 中,您可以制作完全根据您的制作过程生成的页面:
对于 PL/SQL 页面进程,输入以下内容:
<前><代码>开始
我的程序;
htmldb_application.g_unrecoverable_error := true;
结尾;
创建您的过程(您拥有的代码应该可以正常工作)并且它应该可以正常工作。
>
编辑:“myprocedure”中的代码应该发出 HTML 代码,包括 HTML 和 BODY 标记。
In Apex you can make a page that is completely generated from a procedure of your making:
For PL/SQL Page Process, enter the following:
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.