다음 코드를 시도했지만 전체 페이지가 빈 콘텐츠로 표시됩니다.
1) HTML의 BODY 속성에 붙여 넣기Oracle APEX5에서 PLSql 동적 컨텐츠의 특정 부문을 인쇄하는 방법은 무엇입니까?
<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;
그러나 때 클릭으로 버튼을 누르면 다음과 같이 비어있는 내용이 표시됩니다 ::