How to Print Information Of a Particular DIV

Posted by Aspbimal under JavaScript on 6/29/2014 | Points: 10 | Views : 562 | Status : [Member] | Replies : 4
I Want To Print Partial Information From The web page which lies in a particular DIV.




Responses

Posted by: Bandi on: 6/30/2014 [Member] [MVP] Platinum | Points: 25

Up
0
Down
Refer
http://stackoverflow.com/questions/468881/print-div-id-printarea-div-only

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Aspbimal, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Bandi on: 6/30/2014 [Member] [MVP] Platinum | Points: 25

Up
0
Down
http://www.codeproject.com/Tips/503415/Print-Div-Content-Using-JavaScript
http://thirumalaipm.wordpress.com/2009/09/08/printing-a-webpage-using-javascript-part-1/

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Aspbimal, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Goud.Kv on: 6/30/2014 [Member] [MVP] Gold | Points: 25

Up
0
Down
Hi Bimal.,
Use the Script below,
<script language="javascript" type="text/javascript">

function CallPrint(strid) {
var prtContent = document.getElementById(strid);
var WinPrint = window.open('', '', 'letf=0,top=0,width=800,height=100,toolbar=0,scrollbars=0,status=0,dir=ltr');
WinPrint.document.write(prtContent.innerHTML);
WinPrint.document.close();
WinPrint.focus();
WinPrint.print();
WinPrint.close();
prtContent.innerHTML = strOldOne;
}
</script>

And Call from Button as below,
<asp:button id="BtnPrint" runat="server" onclientclick="javascript:CallPrint('bill');" text="Print" xmlns:asp="#unknown" />

your div also should has name (bill) as we are using that here..

Thanks & Regards,
Krishna

Aspbimal, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Goud.Kv on: 6/30/2014 [Member] [MVP] Gold | Points: 25

Up
0
Down
Try this link http://www.mindfiresolutions.com/Printing-content-of-a-particular-div-1014.php that might helps you

Thanks & Regards,
Krishna

Aspbimal, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response