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 ='', '', 'height=700,width=700'); // SET THE PAGE HEIGHT AND WIDTH
win.document.write('<title>Profile</title>');   // FOR PDF HEADER
win.document.write(style);          // ADD STYLE
win.document.write(sTable);         // PRINT PART OF THE PAGE
win.document.close();     // CLOSE THE CURRENT WINDOW.       
win.print();    // PRINT THE INTENDED PART

Leave a Reply

Your email address will not be published.