html输出模板解析
输出样式如下:
![](https://images2015.cnblogs.com/blog/1174729/201705/1174729-20170531170232211-1739243422.png)
---报表头
output('
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>交强险分部损益表(业务分部)</title>
</head>
<body>
<table bordercolor="#f00" border="1" style="border-collapse:collapse;border:none;" >
<tr >
<td nowrap="nowrap" colspan="10" style="border:none;">
<p align="center" ><strong><big> 交强险分部损益表(业务分部) </big></strong></p></td>
</tr>
<tr >
<td nowrap="nowrap" style="border:none;" ><p align="left"><strong> 编报单位:</strong></p></td>
<td colspan="5" nowrap="nowrap" style="border:none;"><p align="left"><strong>' ||
l_company_des ||
'</strong></p></td>
<td nowrap="nowrap" style="border:none;"><p align="right" ><strong> 报告期:</strong></p></td>
<td nowrap="nowrap" colspan="2" style="border:none;"><p align="left" >' ||
g_period || '</p></td>
<td nowrap="nowrap" style="border:none;"><p align="right" ><strong> 币种:CNY</strong></p></td>
</tr>
<tr >
<td nowrap="nowrap" rowspan="2" ><p align="center" ><strong> 业务分部</strong></p></td>
<td nowrap="nowrap" rowspan="2" ><p align="center" ><strong> 已赚保费 </strong></p></td>
<td nowrap="nowrap" rowspan="2" ><p align="center" ><strong> 赔款支出 </strong></p></td>
<td nowrap="nowrap" rowspan="2" ><p align="center" ><strong> 未决赔款准备金提转差 </strong></p></td>
<td nowrap="nowrap" colspan="2" ><p align="center" ><strong> 经营费用 </strong></p></td>
<td nowrap="nowrap" rowspan="2" ><p align="center" ><strong> 分摊的投资收益 </strong></p></td>
<td nowrap="nowrap" rowspan="2" ><p align="center" ><strong> 经营利润 </strong></p></td>
<td nowrap="nowrap" rowspan="2" ><p align="center" ><strong> 期初累计经营利润 </strong></p></td>
<td nowrap="nowrap" rowspan="2" ><p align="center" ><strong> 期末累计经营利润 </strong></p></td>
</tr>
<tr >
<td nowrap="nowrap" ><p align="center" ><strong> 专属费用 </strong></p></td>
<td nowrap="nowrap" ><p align="center" ><strong> 分摊的共同费用 </strong></p></td>
</tr>');
---输出主要信息,下面用循环输出,不用太在意具体细节
for out_r in (select *
from rg_report_axes rrc
where rrc.axis_set_id = r_axis_set_id
order by rrc.axis_seq)
loop
output('<tr >
<td nowrap="nowrap" ><p align="center" ><strong> ' ||
out_r. description || '</strong></p></td>');
for out_c in (select *
from rg_report_axes rrc
where rrc.axis_set_id = c_axis_set_id
order by rrc.axis_seq)
loop
output('<td nowrap="nowrap" ><p align="right">' ||
nvl(array_during_amount(out_r.axis_seq)
(out_c.axis_seq),
0) || '</p></td>');
end loop out_c;
output(' </tr>');
end loop out_r;
-------------报表尾
output(' </table>
</body>
</html>');
以下为语法分析: