How to Print gridview data in asp.net using C#
To print GridView Data using JavaScript follow this steps.
- Take a GridView Control on your ASP.Net Page.
- Bind the GridView as Per ADO.Net.
- Then Write the JavaScript Code as below to print the gridView Data .
function PrintGridViewData() {
var GridPrint = document.getElementById('<%=GridView1.ClientID %>');
GridPrint.border = 0;
var windowPrint= window.open('', 'PrintGridViewData','left=100,top=100,width=1000,height=1000,tollbar=0,scrollbars=1,status=0,resizable=1');
windowPrint.document.write(GridPrint .outerHTML);
windowPrint.document.close();
windowPrint.focus();
windowPrint.print();
windowPrint.close();
}
Print Gridview Data
No comments:
Post a Comment