Click here to Skip to main content
15,914,071 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionHow to print specified contents in .NET 2.0? Pin
salon11-Oct-07 0:53
salon11-Oct-07 0:53 
AnswerRe: How to print specified contents in .NET 2.0? Pin
Amit Agarrwal11-Oct-07 1:04
Amit Agarrwal11-Oct-07 1:04 
GeneralRe: How to print specified contents in .NET 2.0? Pin
salon11-Oct-07 1:06
salon11-Oct-07 1:06 
AnswerRe: How to print specified contents in .NET 2.0? Pin
Sandeep Akhare11-Oct-07 1:09
Sandeep Akhare11-Oct-07 1:09 
GeneralRe: How to print specified contents in .NET 2.0? Pin
salon11-Oct-07 1:49
salon11-Oct-07 1:49 
GeneralRe: How to print specified contents in .NET 2.0? Pin
Sandeep Akhare11-Oct-07 1:53
Sandeep Akhare11-Oct-07 1:53 
GeneralRe: How to print specified contents in .NET 2.0? Pin
salon11-Oct-07 2:00
salon11-Oct-07 2:00 
GeneralRe: How to print specified contents in .NET 2.0? Pin
Sandeep Akhare11-Oct-07 2:19
Sandeep Akhare11-Oct-07 2:19 
No it is not right way content don't have preint functionality
do one thing give the class name as printable to that div and use the below method i know its not right but you don't know javascript properly
<br />
<script type="text/javascript"><br />
      function Print()<br />
{<br />
  var copy = document.documentElement.cloneNode(true);<br />
	var headContent = copy.getElementsByTagName("head");<br />
	var divs = copy.getElementsByTagName("div");<br />
  var content = "";  <br />
<br />
  <br />
	content = '<html>';<br />
	content += '<head>' + headContent[0].innerHTML + '</head>';<br />
	content += '<body  >';<br />
	for(i=0; i < divs.length; i++) <br />
	{	<br />
		var div = divs[i];<br />
		if(div.className == "Printable")<br />
		{content += div.innerHTML;}<br />
		else if(div.className == "NotPrintable" && div.innerHTML.length > 0)<br />
		{content = content.replace(div.innerHTML,'');}<br />
	}<br />
  content += '\n</body></html>';<br />
	var pWin = window.open('', 'Print','directories=0,height=480,width=578,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=yes');<br />
  pWin.document.open();<br />
	pWin.document.write(content);<br />
	pWin.document.close();<br />
	pWin.print();<br />
}<br />
</script><br />
<br />
Check this one<br />
<br />


Thanks and Regards
Sandeep

If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "




AnswerRe: How to print specified contents in .NET 2.0? Pin
N a v a n e e t h11-Oct-07 2:19
N a v a n e e t h11-Oct-07 2:19 
GeneralRe: How to print specified contents in .NET 2.0? Pin
salon11-Oct-07 2:24
salon11-Oct-07 2:24 
GeneralRe: How to print specified contents in .NET 2.0? Pin
N a v a n e e t h11-Oct-07 2:31
N a v a n e e t h11-Oct-07 2:31 
Questiontotal and subtotal in datagrid Pin
Amit Agarrwal11-Oct-07 0:48
Amit Agarrwal11-Oct-07 0:48 
AnswerRe: total and subtotal in datagrid Pin
Spunky Coder11-Oct-07 1:12
Spunky Coder11-Oct-07 1:12 
AnswerRe: total and subtotal in datagrid Pin
Imran Khan Pathan11-Oct-07 1:26
Imran Khan Pathan11-Oct-07 1:26 
Questionhow write custom validation component? Pin
zeroonea11-Oct-07 0:41
zeroonea11-Oct-07 0:41 
AnswerRe: how write custom validation component? Pin
Sandeep Akhare11-Oct-07 1:18
Sandeep Akhare11-Oct-07 1:18 
GeneralRe: how write custom validation component? Pin
zeroonea11-Oct-07 3:42
zeroonea11-Oct-07 3:42 
GeneralRe: how write custom validation component? Pin
Sandeep Akhare11-Oct-07 19:48
Sandeep Akhare11-Oct-07 19:48 
GeneralRe: how write custom validation component? Pin
zeroonea12-Oct-07 19:05
zeroonea12-Oct-07 19:05 
AnswerRe: how write custom validation component? Pin
zeroonea13-Oct-07 21:58
zeroonea13-Oct-07 21:58 
Questioninsert the text in Image Button Pin
rockz...11-Oct-07 0:20
rockz...11-Oct-07 0:20 
AnswerRe: insert the text in Image Button Pin
Christian Graus11-Oct-07 0:27
protectorChristian Graus11-Oct-07 0:27 
QuestionHow i can view image from access data base Pin
Piyush Vardhan Singh11-Oct-07 0:14
Piyush Vardhan Singh11-Oct-07 0:14 
AnswerRe: How i can view image from access data base Pin
Christian Graus11-Oct-07 0:28
protectorChristian Graus11-Oct-07 0:28 
AnswerRe: How i can view image from access data base Pin
Sandeep Akhare11-Oct-07 1:38
Sandeep Akhare11-Oct-07 1:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.