oracle plsql index_by表 clear,在Oracle ERP中使用PLSQL 结合HTML 写报表.pdf

ERP REPORT

PL/SQL 结合HTML 写报表

作者:Team

在 ORACLE ERP 里面,大家都很习惯用 REPORT BUILDER 来写报表,REPORT

BUILDER 写出来的报表上挂到用系统里面,然后提交后台请求输出报表;我这里介绍另

外一种比较方便的写报表的方式,整个报表是用FORM 、PL/SQL 结合HTML 语言来写;

我们知道ORACLE 数据库提供一个包叫HTP ,专门是用于写网页报表的;我们这里也将

要用到;

这个包里面有一些组件:

htp.print

语法 htp.print (cbuf | dbuf | nbuf);

作用 generates a line in an HTML document.

参数 cbuf in varchar2 or

dbuf in date or

nbuf in number

Generates Generates a line in an HTML document based on the value passed to it.

htp.p

Alias for htp.print

Structure Tags 结构标记

The following tags are used to identify the major parts of an HTML

document.

Note : Although this section shows hypertext procedures (HTP), all of

them are also available as hypertext functions (HTF).

htp.htmlOpen

语法 htp.htmlOpen;

作用 Prints a tag that indicates the beginning of an HTML document

ERP REPORT

参数 none

Generates

htp.htmlClose

语法 htp.htmlClose;

作用 Prints a tag that indicates the end of an HTML document

参数 none

Generates

htp.headOpen

语法 htp.headOpen;

作用 Prints a tag that indicates the beginning of the HTML document head

参数 none

Generates

htp.headClose

语法 htp.headClose;

作用 Prints a tag that indicates the end of the HTML document head

参数 none

Generates

htp.bodyOpen

语法 htp.bodyOpen (cbackground, cattributes);

作用 Prints the tag that identifies the beginning of the body of an HTML document, and

allows you to specify an image as the background of the document

参数 cbackground in varchar2 DEFAULT NULL

cattributes in varchar2 DEFAULT NULL

Generates

Note : If

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
初学oracle报表开发笔记 -- process report output('<HTML xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel">'); output('<head>'); output('<title>库存现有量报表</title>'); output('<style>'); output('body,table{font-size:13px;font-family:"Book Antiqua","Segoe UI", Tahoma, "Trebuchet MS", verdana, helvetica, arial, sans-serif, Georgia;}.text {mso-number-format:"\@";}.retnum {mso-number-format:"0\.00";}'); output('</style>'); output('</head>'); output('<body>'); output('<h2 align=center><B>库存现有量报表</B></h2>'); output('<table width=600 border=0 bordercolor=black>'); output(' <tr>'); output('<th align=right>OU:</th>'); output('<td align=left>' || g_ou_name || '</td>'); output('<th align=right>组织:</th>'); output('<td align=left>' || l_organization_name || '</td>'); output(' </tr>'); output('</table>'); output('<table width=1800 border=1 bordercolor=black>'); output(' <tr>'); output('<th rowspan=1 width=50>库存组织编码</th>'); output('<th rowspan=1 width=50>库存组织说明</th>'); output('<th rowspan=1 width=50>子库编码</th>'); output('<th rowspan=1 width=50>子库说明</th>'); output('<th rowspan=1 width=50>物品编码</th>'); output('<th rowspan=1 width=50>物品说明</th>'); output('<th rowspan=1 width=50>批次</th>'); output('<th rowspan=1 width=50>库存量 </th>'); output('<th rowspan=1 width=50>最小库存量</th>'); output('<th rowspan=1 width=50>最大库存量</th>'); output(' </tr>'); FOR cl IN (select OOD.ORGANIZATION_CODE, --库存组织编码 OOD.ORGANIZATION_NAME, --库存组织说明 MSA.SECONDARY_INVENTORY_NAME subinventory_code, --子库编码 MSA.DESCRIPTION subinventory_name, --子库说明 MSIV.SEGMENT1 item_no, --物品编码 MSIV.DESCRIPTION item_desc, --物品说明 MOQD.LOT_NUMBER, --批次 sum(MOQD.Primary_Transaction_Quantity) Primary_Transaction_Quantity, --库存量 MSIV.MIN_MINMAX_QUANTITY, --最小库存量 MSIV.MAX_MINMAX_QUANTITY --最大库存量 from mtl_onhand_quantities_detail moqd, ORG_ORGANIZATION_DEFINITIONS OOD, mtl_subinventories_all_v MSA, MTL_SYSTEM_ITEMS_VL MSIV where moqd.inventory_item_id = msiv.INVENTORY_ITEM_ID and moqd.organization_id = msiv.ORGANIZATION_ID and moqd.organization_id = ood.ORGANIZATION_ID and moqd.subinventory_code = msa.SECONDARY_INVENTORY_NAME and moqd.organization_id = msa.ORGANIZATION_ID group by OOD.ORGANIZATION_CODE, OOD.ORGANIZATION_NAME, MSA.SECONDARY_INVENTORY_NAME, MSA.DESCRIPTION, MSIV.SEGMENT1, MSIV.DESCRIPTION, MOQD.LOT_NUMBER, MSIV.MIN_MINMAX_QUANTITY, MSIV.MAX_MINMAX_QUANTITY) LOOP output(' <tr>'); output(' <td align=left><font size=1>' || cl.ORGANIZATION_CODE || '</font></td>'); output(' <td align=left><font size=1>' || cl.ORGANIZATION_NAME || '</font></td>'); output(' <td align=left><font size=1>' || cl.subinventory_code || '</font></td>'); output(' <td align=left><font size=1>' || cl.subinventory_name || '</font></td>'); output(' <td align=left><font size=1>' || cl.item_no || '</font></td>'); output(' <td align=left><font size=1>' || cl.item_desc || '</font></td>'); output(' <td align=left><font size=1>' || cl.LOT_NUMBER || '</font></td>'); output(' <td align=left><font size=1>' || cl.Primary_Transaction_Quantity || '</font></td>'); output(' <td align=left><font size=1>' || cl.MIN_MINMAX_QUANTITY || '</font></td>'); output(' <td align=left><font size=1>' || cl.MAX_MINMAX_QUANTITY || '</font></td>'); output(' </tr>');

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值