Hi,<br>One of the hurdles I am facing is printing only a part of the page/ a particular html div. By googling, I tried to do the following steps, but still not able to succeed.<br><br>I followed instruction given in <a href="http://www.huntingground.freeserve.co.uk/main/mainfram.htm?../scripts/printing.htm">
http://www.huntingground.freeserve.co.uk/main/mainfram.htm?../scripts/printing.htm</a><br><br><b>1) created a Javascript printWindow.js&nbsp;&nbsp; with the Js code mentioned there.</b><br><br>MyLibrary&gt;&gt;printwindowJs<br>&nbsp;&nbsp;&nbsp; ^ &#39;&lt;script type=&quot;text/javascript&quot;&gt;
<br>&lt;!--<br>function printContent(id){<br>str=document.getElementById(id).innerHTML<br>newwin=window.open(&#39;&#39;&#39;&#39;,&#39;&#39;printwin&#39;&#39;,&#39;&#39;left=100,top=100,width=400,height=400&#39;&#39;)<br>
newwin.document.write(&#39;&#39;&lt;HTML&gt;\n&lt;HEAD&gt;\n&#39;&#39;)<br>newwin.document.write(&#39;&#39;&lt;TITLE&gt;Print Page&lt;/TITLE&gt;\n&#39;&#39;)<br>newwin.document.write(&#39;&#39;&lt;script&gt;\n&#39;&#39;)<br>
newwin.document.write(&#39;&#39;function chkstate(){\n&#39;&#39;)<br>newwin.document.write(&#39;&#39;if(document.readyState==&quot;complete&quot;){\n&#39;&#39;)<br>newwin.document.write(&#39;&#39;window.close()\n&#39;&#39;)
<br>newwin.document.write(&#39;&#39;}\n&#39;&#39;)<br>newwin.document.write(&#39;&#39;else{\n&#39;&#39;)<br>newwin.document.write(&#39;&#39;setTimeout(&quot;chkstate()&quot;,2000)\n&#39;&#39;)<br>newwin.document.write(&#39;&#39;}\n&#39;&#39;)
<br>newwin.document.write(&#39;&#39;}\n&#39;&#39;)<br>newwin.document.write(&#39;&#39;function print_win(){\n&#39;&#39;)<br>newwin.document.write(&#39;&#39;window.print();\n&#39;&#39;)<br>newwin.document.write(&#39;&#39;chkstate();\n&#39;&#39;)
<br>newwin.document.write(&#39;&#39;}\n&#39;&#39;)<br>newwin.document.write(&#39;&#39;&lt;\/script&gt;\n&#39;&#39;)<br>newwin.document.write(&#39;&#39;&lt;/HEAD&gt;\n&#39;&#39;)<br>newwin.document.write(&#39;&#39;&lt;BODY onload=&quot;print_win()&quot;&gt;\n&#39;&#39;)
<br>newwin.document.write(str)<br>newwin.document.write(&#39;&#39;&lt;/BODY&gt;\n&#39;&#39;)<br>newwin.document.write(&#39;&#39;&lt;/HTML&gt;\n&#39;&#39;)<br>newwin.document.close()<br>}<br>//--&gt;<br>&lt;/script&gt;&#39;
<br clear="all"><br><br><b>2) Added the above Js in #updateRoot: of my rootComponent</b><br><br>MyRoot&gt;&gt;updateRoot: anHtmlRoot <br>&nbsp;&nbsp;&nbsp; super updateRoot: anHtmlRoot.<br>&nbsp;&nbsp;&nbsp; anHtmlRoot javascript&nbsp; url: &#39;/seaside/files/ToDoLibrary/printwindow.js&#39;
<br><br><br><b>3) MyRoot&gt;&gt;renderContentOn: html</b><br><br>html div id: &#39;div1&#39;; with: [ ........... ].<br>html div id: &#39;div2&#39;; with: [ ........... ].<br>html div id: &#39;div3&#39;; with: [ ........... ].
<br>html div id: &#39;div4&#39;; with: [ html text: &#39;Print this Div&#39;.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; html space.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; html html: &#39;&lt;a href=&quot;#null&quot; onclick=&quot;printContent( &#39; &#39;div4&#39; &#39; );&quot;&gt;Click to print div 4&lt;/a&gt;&#39;.
<br><br>&nbsp;&nbsp;&nbsp; html anchor url: &#39;#&#39;; onClick: &#39;printContent( &#39; &#39;printListView&#39; &#39; )&#39;;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; with: &#39;Print div 4 &#39; .<br><br>I have used both raw html code and modified Seaside/squeak code (I hope its equivalent). When I click on any of the anchors, nothing happens. I get the following error in Firebug(firefox)
<br><br><div style="color: rgb(255, 0, 0);" class="errorTitle"><b>printContent is not defined</b></div><div class="objectBox objectBox-stackFrame"><b><a style="color: rgb(255, 0, 0);" class="objectLink">onclick</a><span style="color: rgb(255, 0, 0);">
(</span><a style="color: rgb(255, 0, 0);" class="objectLink objectLink-object">click clientX=0, clientY=0</a><span style="color: rgb(255, 0, 0);" class="arrayComma"></span><span style="color: rgb(255, 0, 0);">)</span></b>
<br><br><br>I crosschecked the inclusion of printwindow.js and it is indeed included in the Firebug Js browser.<br><br>I hope you people can help me where I am committing a dumb mistake(maybe) or is there a better way to print only a div.
<br><br>Thanks &amp; Regards,<br>Rajeev<br></div><br><br><br>-- <br>Rajeev Lochan<br><br>Co-founder, AR-CAD.com<br><br><a href="http://www.ar-cad.com">http://www.ar-cad.com</a><br>+91 9243468076 (Bangalore)<br>080 65355873