0

update this function to add print preview and then a link(print) in the print preview to print the preview page

    function PrintPanel() {

        var panel = document.getElementById("<%=pnlContents.ClientID %>");

        var printWindow = window.open('', '', 'height=400,width=800');

        printWindow.document.write('<html><head><title>DIV Contents</title>');

        printWindow.document.write('</head><body >');

        printWindow.document.write(panel.innerHTML);

        printWindow.document.write('</body></html>');

        printWindow.document.close();

        setTimeout(function () {

            printWindow.print();

        }, 500);

        return false;

    }

</script>

1 Answers1

0

You can use the built in print Preview control for displaying the print preview in the form. see the screen shot for placing the print preview control in the form selected item is the control and the gray colored region is the preview area

Suji
  • 1,326
  • 1
  • 12
  • 27