Friday, 19 April 2013

Print only gridview data with preview using javascript


///  print grid data directly
function PrintGridData() {
var prtGrid = document.getElementById('<%=GDVBOQDetail.ClientID %>');
prtGrid.border = 0;
var prtgriddata = window.open('', 'GDVBOQDetail', 'left=100,top=100,width=1000,height=1000,tollbar=0,scrollbars=1,status=0,resizable=1');
prtgriddata .document.write(prtGrid.outerHTML);
prtgriddata .document.close();
prtgriddata .focus();
prtgriddata .print();
prtgriddata .close();
}

print preview then print


function PrintGridData() {
var prtGrid = document.getElementById('<%=GDVBOQDetail.ClientID %>');
prtGrid.border = 0;
var prtgriddata = window.open('', 'GDVBOQDetail', 'left=100,top=100,width=1000,height=1000,tollbar=0,scrollbars=1,status=0,resizable=1');
prtgriddata .document.write(prtGrid.outerHTML);
prtgriddata .document.close();
prtgriddata .focus();
//prtgriddata .print();
//prtgriddata .close();
}

No comments:

Post a Comment

How to highlight selected text in notepad++

  –> To highlight a block of code in Notepad++, please do the following steps step-1  :- Select the required text. step-2  :- Right click...