function printItn(strid) {
//In my case i have append gridview in Panel that y..you can put your contentID which is you want to print.
var printContent = document.getElementById(strid);
var windowUrl = 'about:blank';
var uniqueName = new Date();
var windowName = 'Print' + uniqueName.getTime();
// you should add all css refrence for your Gridview. something like.
Shoaib Rashi...
Member
291 Points
116 Posts
GridView Area Print
Apr 04, 2012 04:45 PM|LINK
function printItn(strid) {
//In my case i have append gridview in Panel that y..you can put your contentID which is you want to print.
var printContent = document.getElementById(strid);
var windowUrl = 'about:blank';
var uniqueName = new Date();
var windowName = 'Print' + uniqueName.getTime();
// you should add all css refrence for your Gridview. something like.
var WinPrint = window.open(windowUrl, windowName, 'left=300,top=300,right=500,bottom=500,width=1000,height=500'); WinPrint.document.write('<' + 'html' + '><head><link href="cssreference" rel="stylesheet" type="text/css" /><link href="../App_Themes/Default/style.css" rel="stylesheet" type="text/css" /></head><' + 'body style="background:none !important"' + '>');
WinPrint.document.write(printContent.innerHTML);
WinPrint.document.write('<' + '/body' + '><' + '/html' + '>');
WinPrint.document.close();
WinPrint.focus();
WinPrint.print();
WinPrint.close();
}
javascript
SonicMan
Participant
1472 Points
228 Posts
Re: GridView Area Print
Apr 06, 2012 10:28 AM|LINK
Good job