Report_客制化以PLSQL输出HTML标记完成WEB报表(案例)

  1. 建立Procedure, 以输出HTML标记

  2. 树立Program Execuable,
    设定程式为bxj_html_invoice_report.main

  3. 建立Concurrent
    Program并发程式,输出格局为HTML

 

图片 1三、案例测试

  • 优点
    • 输出的文书,可以一直另存为execel或者word格式
    • 布局简单
    • 在调节时,只需数据库编译即可,不要像rdf文件上传至server
  • 缺点
    • 先后包方式的费用,没有可视化界面
    • 对相比复杂格式的表格需求较大的代码量
    • 输出的为HTML标记,爆发的文件会相比较大

4.
运行程式并测试http://i.cnblogs.com/EditPosts.aspx?opt=1

 

需求:客户须要以HTML的样式展现供应商音信

Step2. 确立Program Execuable,
设定程式为bxj_html_invoice_report.main

 1 procedure bxj_html_invoice_report(Errbuf Out Varchar2, Retcode Out Number) is
 2   cursor cur_invoice is
 3     select pv.VENDOR_NAME,
 4            aiv.invoice_num,
 5            aiv.invoice_date,
 6            aiv.invoice_amount,
 7            aiv.invoice_currency_code
 8       from Ap_Invoices_All aiv, po.po_vendors pv
 9      where rownum <= 100;
10   l_invoice cur_invoice%rowtype;
11 begin
12   apps.Fnd_File.Put_line(apps.FND_FILE.OUTPUT, '<html><head>');
13   apps.Fnd_File.Put_line(apps.FND_FILE.OUTPUT, '<style type="text/css">');
14   apps.Fnd_File.Put_line(apps.FND_FILE.OUTPUT,'* { margin: 0; padding: 0;}');
15   apps.Fnd_File.Put_line(apps.FND_FILE.OUTPUT,'.all { width: 100%; border: 1px solid#000000;}');
16   apps.Fnd_File.Put_line(apps.FND_FILE.OUTPUT, '.title {width: 99%; }');
17   apps.Fnd_File.Put_line(apps.FND_FILE.OUTPUT,'table {width: 100%; border: 1px solid#FF00FF; border-collapse: collapse; table-layout:fixed; }');
18   apps.Fnd_File.Put_line(apps.FND_FILE.OUTPUT,'table tr th { border: 1px solid #FF00FF;overflow: hidden; word-break: break-all; text-overflow: ellipsis; white-space: nowrap;}');
19   apps.Fnd_File.Put_line(apps.FND_FILE.OUTPUT,'table tr td { border: 1px solid #FF00FF;overflow: hidden; /*word-wrap: break-word; 内容将在边界内换行*/word-break: break-all;');
20   apps.Fnd_File.Put_line(apps.FND_FILE.OUTPUT,'text-overflow: ellipsis; white-space:nowrap;}');
21   apps.Fnd_File.Put_line(apps.FND_FILE.OUTPUT,'.content {width: 100%; height: 80%;overflow: scroll; }');
22   apps.Fnd_File.Put_line(apps.FND_FILE.OUTPUT,'.content div { width: 100%; }</style>');
23   apps.Fnd_File.Put_line(apps.FND_FILE.OUTPUT,'</head><body><div class="all">');
24   --表头
25   apps.Fnd_File.Put_line(apps.FND_FILE.OUTPUT,'<div class="title"><table><tr>');
26   apps.Fnd_File.Put_line(apps.FND_FILE.OUTPUT,'<thstyle="width:30%">VENDOR NAME</th>');
27   apps.Fnd_File.Put_line(apps.FND_FILE.OUTPUT,'<thstyle="width:20%">INVOICE Number</th>');
28   apps.Fnd_File.Put_line(apps.FND_FILE.OUTPUT,'<thstyle="width:20%">INVOICE Date</th>');
29   apps.Fnd_File.Put_line(apps.FND_FILE.OUTPUT,'<thstyle="width:10%">INVOICE Amount</th>');
30   apps.Fnd_File.Put_line(apps.FND_FILE.OUTPUT,'<thstyle="width:10%">Currency Code</th>');
31   apps.Fnd_File.Put_line(apps.FND_FILE.OUTPUT,'<thstyle="width:10%">Note</th> ');
32   apps.Fnd_File.Put_line(apps.FND_FILE.OUTPUT, '</tr></table></div>');
33   --内容
34   apps.Fnd_File.Put_line(apps.FND_FILE.OUTPUT,'<div class="content"><div><table>');
35   open cur_invoice;
36   loop
37     fetch cur_invoice
38       into l_invoice;
39     exit when cur_invoice%notfound;
40     apps.Fnd_File.Put_line(apps.FND_FILE.OUTPUT, '<tr>');
41     apps.Fnd_File.Put_line(apps.FND_FILE.OUTPUT,'<td style="width:30%">' || l_invoice.VENDOR_NAME || '</td>');
42     apps.Fnd_File.Put_line(apps.FND_FILE.OUTPUT,'<td style="width:20%">' || l_invoice.invoice_num || '</td>');
43     apps.Fnd_File.Put_line(apps.FND_FILE.OUTPUT,'<td style="width:20%">' || l_invoice.invoice_date || '</td>');
44     apps.Fnd_File.Put_line(apps.FND_FILE.OUTPUT,'<td style="width:10%">' || l_invoice.invoice_amount || '</td>');
45     apps.Fnd_File.Put_line(apps.FND_FILE.OUTPUT,'<td style="width:10%">' || l_invoice.invoice_currency_code || '</td>');
46     apps.Fnd_File.Put_line(apps.FND_FILE.OUTPUT,'<td style="width:10%">&nbsp;</td>');
47     apps.Fnd_File.Put_line(apps.FND_FILE.OUTPUT, '</tr>');
48   end loop;
49   close cur_invoice;
50   apps.Fnd_File.Put_line(apps.FND_FILE.OUTPUT, '</table></div></div>');
51   apps.Fnd_File.Put_line(apps.FND_FILE.OUTPUT, '</body></HTML>');
52 end;
53 end cux_html_invoice_report;

HTML报表的兑现形式

图片 2

参考:王重东
http://wenku.baidu.com/link?url=VcQejF0TbWNkYERcGkRZVJOA\_NUtaeiziImjTXkmyB0BgSI9IS3lErFhy-1hPoBYbsXf5MfYP1mh0Az83jec7Tm23rxKjQsYE0GiTUpEJmG

输出HTML标记程式



 

Thanks and Regards

图片 3

通过在数据库中平素暴发HTML格式的文书,成为HMTL报表

  • 优点
    • 拔取图形化的开发格局,相比较直观
    • 有作用强大的开首
    • 相比较复杂格式的报表也并非通过太多代码来已毕
    • 最后结果以一个独立的公文的款式彰显,相比较不难传递
  • 缺点
    • 很难转成execel格式文件
    • 尽管有布局编辑器,不过实际编写进程中,其宽度和岗位的拖动比较麻烦

2014-05-31 Created By BaoXinjian


 

Step1. 建立Procedure,
以输出HTML标记

图片 4图片 5

  • 通过在数额库端调用进度fnd_file.put_line生产文件
  • 在转移文书进程中经过动态加入html标记已毕公文的格式化
  • html文件本身能够直接转换为excel方式仍然word当个事

图片 6

参照:赛意咨询
http://wenku.baidu.com/link?url=lDoNquiWPnFoazuRRCtvjjBoFBh9TuuFG\_5gXVNXKHunzvDMcp1ZQA19mwcnuCFWengm0eBdV23\_F\_qzMuaKoCsjZzDN1rBi7ZS4w6OJ-f7 

图片 7

Step3. 手无寸铁Concurrent
Program并发程式,注意输出格局HTML,其余设定与一般CP无太大不一致

Test1. 调用Concurrent
Program并发程式,输出情势为HTML,查看输出

图片 8二、案例

 

Oracle Report
Builder开发的字符形式的表格,成为系统报表

图片 9一. 摘要

相关文章