locked
Asp.Net Print to GridView RRS feed

  • Question

  • Hello everyone. I want to do print to gridview. My gridview below.But I want to do like below . İts a possible?

    I have code . I am using DataTable and Entity.

     <script type="text/javascript">
            function printGrid() {
                var gridData = document.getElementById('<%= example.ClientID %>');
                 var windowUrl = 'Yurt Dışı Kargo';

                 //set print document name for gridview
                 var uniqueName = new Date();
                 var windowName = 'Print_' + uniqueName.getTime();

                 var prtWindow = window.open(windowUrl, windowName, 'left=100,top=100,right=100,bottom=100,width=700,height=500');
                 prtWindow.document.write('<html><head></head>');
                 prtWindow.document.write('<body style="background:none !important">');
                 prtWindow.document.write(gridData.outerHTML);
                 prtWindow.document.write('</body></html>');
                 prtWindow.document.close();
                 prtWindow.focus();
                 prtWindow.print();
                 prtWindow.close();
             }
        </script>

    • Moved by CoolDadTx Tuesday, November 17, 2015 5:26 PM Wrong forums
    Tuesday, November 17, 2015 2:04 PM

Answers