How to make pritable page in APEX

It can be done with Javascript. The following Javascript code, make the intended part of page as printable. You can create a dynamic action for this.

var sTable = $("#doc .t-Region-bodyWrap").html();

var style = "<style>";                                
style = style + ".table {width: 100%;font: 8px Calibri;}";
style = style + ".table, th, td { border-collapse: collapse;";                
style = style + "padding: 2px 2px;}";
style = style + "</style>";


var win = window.open('', '', 'height=700,width=700'); // SET THE PAGE HEIGHT AND WIDTH
win.document.write('<html><head>');
win.document.write('<title>Profile</title>');   // FOR PDF HEADER
win.document.write(style);          // ADD STYLE
win.document.write('</head>');
win.document.write('<body>');
win.document.write(sTable);         // PRINT PART OF THE PAGE
win.document.write('</body></html>');
win.document.close();     // CLOSE THE CURRENT WINDOW.       
win.print();    // PRINT THE INTENDED PART

Leave a Reply

Your email address will not be published.