Step 1:
=====
Create Region.
Position: Dialog Footer
Type: PLSQL Dynamic Content
PLSQL Code:
htp.p('
<!--div id="div_print2" align="left"-->');
HTP.P('<div id="printableArea" style="font-size:12px;">');
htp.p('<div id="div_print2" align="left">');
htp.p('<head>');
htp.p('<style>
table tr, td {
//border: 1px solid gray;
//border-collapse: collapse;
}
table tr, th {
border: 1px solid gray;
//border-collapse: collapse;
}
table tr.noBorder td {
border: 0;
}
@media print {
header{
position: fixed;
top: 0;
width: 100%;
text-align: center;
}
footer {
position: fixed;
bottom: 0;
width: 100%;
text-align: center;
}
.content-block, p {
page-break-inside: auto; //avoid;
}
}
@page {
size: 12in 8in;
size: landscape; //portrait;
}
</style>');
htp.p('</head>');
DECLARE
v_pay varchar2(100);
v_inv varchar2(100);
v_clbal varchar2(100);
BEGIN
SELECT SUM(COLLECTION) , SUM(INVOICE) , SUM(CLOSING_BALANCE)
INTO v_pay, v_inv, v_clbal
FROM TABLE_NAME;
HTP.P('
<table cellpadding="1" cellspacing="0" style="width:100%;font-size:12px; ">
<tr class="noBorder">
<td style="font-size:20px; text-align: right;color: red;font-weight: 500;"> Total Collection : </td>
<td style="font-size:20px; font-weight: bold; text-align: left;"> '||to_char(v_pay,'999G999G999G999G990D00')||' </td>
<td style="font-size:20px; text-align: right;color: red;font-weight: 500;"> Total Invoice : </td>
<td style="font-size:20px; font-weight: bold; text-align: left;"> ' ||to_char(v_inv,'999G999G999G999G990D00') ||' </td>
<td style="font-size:20px; text-align: right;color: red;font-weight: 500;"> Balance : </td>
<td style="font-size:20px; font-weight: bold; text-align: left;"> ' ||to_char(v_clbal,'999G999G999G999G990D00')||' </td>
</tr>
</table>
</br>
');
htp.p('</table></div>');
--EXCEPTION when no_data_found then null;WHEN OTHERS THEN RAISE;
END;
HTP.P('</div>');
htp.p('</div>');