Я пробовал следующий код, но вся страница показывает с пустым содержимым.
1) ПАСТА в атрибуте BODY HTMLКак напечатать конкретное Div из динамического содержимого PLSql в Oracle APEX5?
<script language="JavaScript">
function printPage() {
if(document.all) {
document.all.divButtons.style.visibility = 'hidden';
window.print();
document.all.divButtons.style.visibility = 'visible';
} else {
document.getElementById('divButtons').style.visibility = 'hidden';
window.print();
document.getElementById('divButtons').style.visibility = 'visible';
}
}
</script>
2) htp.p('<div id="divButtons" name="divButtons">'); htp.p('</div>');
3) htp.p('<input type="button" value = "Print" onclick="printPage()" style="font:bold 11px verdana;color:#FF0000;background-color:#FFFFFF;">');
А вот это PLSQL динамические коды контента :::
DECLARE
CURSOR order_list IS
SELECT m.item_name, a.order_quantity,a.price
FROM add_payment a,menu_item m
where order_id=61
and
m.m_id=a.m_id;
begin
htp.p('<div class="row">');
htp.p('<div class="col-md-12">');
htp.p('<div class="panel panel-default">');
htp.p('<div class="panel-heading">');
htp.p('<h3 class="text-center">');
htp.p('<strong>Order Summary');
htp.p('</strong>');
htp.p('</h3>');
htp.p('</div>');
htp.p('<div class="panel-body">');
htp.p('<div class="table-responsive">');
htp.p('<div id="divButtons" name="divButtons">');
htp.p('<table class="table table-condensed">');
htp.p('<thead>');
htp.p('<tr>');
htp.p('<td>');
htp.p('<strong>Item Name');
htp.p('</strong>');
htp.p('</td>');
htp.p('<td class="text-center">');
htp.p('<strong>Item Price');
htp.p('</strong>');
htp.p('</td>');
htp.p('<td class="text-center">');
htp.p('<strong>Item Quantity');
htp.p('</strong>');
htp.p('</td>');
htp.p('<td class="text-right">');
htp.p('<strong>Total');
htp.p('</strong>');
htp.p('</td>');
htp.p('</tr>');
htp.p('</thead>');
htp.p('<tbody>');
FOR a IN order_list LOOP
htp.p('<tr>');
htp.p('<td>'||a.item_name||'');
htp.p('</td>');
htp.p('<td class="text-center">'||a.order_quantity||'');
htp.p('</td>');
htp.p('<td class="text-center">'||a.price||'');
htp.p('</td>');
htp.p('<td class="text-right">'||a.order_quantity*a.price||' Tk');
htp.p('</td>');
htp.p('</tr>');
END LOOP;
htp.p('<tr>');
htp.p('<td class="highrow">');
htp.p('</td>');
htp.p('<td class="highrow">');
htp.p('</td>');
htp.p('<td class="highrow text-center">');
htp.p('<strong>Subtotal');
htp.p('</strong>');
htp.p('</td>');
htp.p('<td class="highrow text-right">$958.00');
htp.p('</td>');
htp.p('</tr>');
htp.p('<tr>');
htp.p('<td class="emptyrow">');
htp.p('</td>');
htp.p('<td class="emptyrow">');
htp.p('</td>');
htp.p('<td class="emptyrow text-center">');
htp.p('<strong>Shipping');
htp.p('</strong>');
htp.p('</td>');
htp.p('<td class="emptyrow text-right">$20');
htp.p('</td>');
htp.p('</tr>');
htp.p('<tr>');
htp.p('<td class="emptyrow">');
htp.p('<i class="fa fa-barcode iconbig">');
htp.p('</i>');
htp.p('</td>');
htp.p('<td class="emptyrow">');
htp.p('</td>');
htp.p('<td class="emptyrow text-center">');
htp.p('<strong>Total');
htp.p('</strong>');
htp.p('</td>');
htp.p('<td class="emptyrow text-right">$978.00');
htp.p('</td>');
htp.p('</tr>');
htp.p('</tbody>');
htp.p('</table>');
htp.p('</div>');
htp.p('</div>');
htp.p('</div>');
htp.p('</div>');
htp.p('</div>');
htp.p('</div>');
htp.p('<input type="button" value = "Print" onclick="printPage()" style="font:bold 11px verdana;color:#FF0000;background-color:#FFFFFF;">');
end;
Но когда щелчок в затем пустое содержимое показано ниже: