Jump to content

maja88g

Members
  • Posts

    8
  • Joined

  • Last visited

Everything posted by maja88g

  1. I have resolved this issue by using an image with a lower resolution.
  2. Hi all, I have a iframe that is populated with customer information dynamically from the javascript. The focus is then set to the iframe and an option to print the iframe is displayed. The information loads perfectly in the iframe but does not print the contents of the iframe, instead it prints the contents of the page that is displaying the iframe. As soon as I remove the image from the document.write then the the contents of the iframe are printed out perfectly. Any ideas what I could be doing wrong? Here is my html code: <iframe id="ifmsselectedorderprint" style="display:block; height: 1px; width: 1px; position: absolute"></iframe> Here is my js code: var pri = document.getElementById("ifmsselectedorderprint").contentWindow;pri.document.open();pri.document.write("<table width='800'><tr align='center'><td><img src='orderprint.bmp'></br></br></td></tr></table><label>_________________________________________________________________________________________________________________________</label><h1><font face='tahoma'><center>Cashbuild: Tembi-Mall Community Store Order Print</center></font></h1><label>_________________________________________________________________________________________________________________________</label><h2><font face='tahoma'><center>Order Details</center></font></h2>");pri.document.write("</br><table border='0'><tr><th><font face='tahoma' size='4'>Order No.</font></th><th width='10'></th><th><font face='tahoma' size='4'>SAP No.</font></th><th width='10'></th><th><font face='tahoma' size='4'>Sub Total</font></th><th width='10'></th><th><font face='tahoma' size='4'>Vat</font></th><th width='10'></th><th><font face='tahoma' size='4'>Rounding</font></th><th width='10'></th><th><font face='tahoma' size='4'>Grand Total</font></th></tr><tr><td><font face='tahoma'>"+orderno+"</font></td><td width='10'></td><td><font face='tahoma'>"+sapno+"</font></td><td width='10'></td><td><font face='tahoma'>"+subtotal+"</font></td><td width='10'></td><td><font face='tahoma'>"+vat+"</font></td><td width='10'></td><td><font face='tahoma'>"+rounding+"</font></td><td width='10'></td><td><font face='tahoma'>"+grandtotal+"</font></td></tr></table></br><label>_________________________________________________________________________________________________________________________</label></br>"); pri.document.close();pri.focus();pri.print(); Without the following code: <table width='800'><tr align='center'><td><img src='orderprint.bmp'></br></br></td></tr></table> It works perfectly. I would also like to stress that in both cases the iframe loaded correctly. Thanks for all the help.
  3. Hi all, I am creating a calculator using images I have created, and am using the onmousedown and onmouseup eventsin html, to simulate 'clicking a button'. This works fine if I press the image at a moderate pace, but if i press the imagemore then once quite fast or if I double click then the image completely disappears. I have tried a number of things to fix this issue incl: timeout, sleep //written function that loops through time, calling a blankon double click, calling the mouse up from the mouse down function instead... but none of this seems to prevent the imagefrom disappearing if it has been double clicked of clicked at a fast pace. The image size is 1.37kb. Any ideas on what I am doing wrong or how I can fix this issue? Here is my html code: <td><image src="../images/keyboardnumbut7.gif" id="button15" onmousedown="mouseDown(this.id, this.src)" onmouseup="mouseUp(this.id, this.src)" onClick="numkeypressed('7')"></td> This is my javascript code: function mouseDown(id, src){var mySplitResultSrc;var mySplitResultImg; mySplitResultSrc = src.split("/");var msrs8 = mySplitResultSrc[8]; mySplitResultImg = msrs8.split(".");var imgname = mySplitResultImg[0];var imgext = mySplitResultImg[1]; document.getElementById(id).src = "../images/"+imgname+"me."+imgext;} function mouseUp(id, src){var mySplitResultSrc;var mySplitResultImg; mySplitResultSrc = src.split("/");var msrs8 = mySplitResultSrc[8]; mySplitResultImg = msrs8.split(".");var fullimgname = mySplitResultImg[0];var imgext = mySplitResultImg[1];var endpos = fullimgname.length - 2;var imgname = fullimgname.substring(0,endpos); document.getElementById(id).src = "../images/"+imgname+"."+imgext;}
  4. Hi all, I am trying to print ALL the content of a scrolling table without usingiframes, opening a new window or hiding all the other elements on my screen. It it possible to send a command that will only print a specific element based onthe id without having to change screen displays? <!--Html table code I need to print, table is dynamically populated from javascript so the length constantly varies.--> <!--some code--><div id="printme"><table border="1" width="598" id="ccblanktableheader"> <tr bgcolor="#E4E5E5"> <th width="15%"><font face="tahoma" color="rgb(6,79,168)">Date</font></th> <th width="20%"><font face="tahoma" color="rgb(6,79,168)">Customer No.</font></th> <th width="23%"><font face="tahoma" color="rgb(6,79,168)">Complaint No.</font></th> <th width="12%"><font face="tahoma" color="rgb(6,79,168)">Status</font></th> <th width="23%"><font face="tahoma" color="rgb(6,79,168)">Type</font></th> <th width="7%"><font face="tahoma" color="rgb(6,79,168)">View</font></th> </tr> </table> <div style="font-size: 12px; face:tahoma; height: 315px; overflow:auto;border:1 "> <table border="1" width="593" id="ccblanktable" align="center"> <tr bgcolor="#E4E5E5"> <th width="15%"></th> <th width="20%"></th> <th width="23%"></th> <th width="12%"></th> <th width="23%"></th> <th width="7%"></th> </tr> </table> </div></div><!--more code--> I have tried multiple javascripts but none work without either opening a new window or changing displays.This was my most recent test. var content_innerhtml = document.getElementById("ccblanktable").innerHTML; var document_print=window.open("","",display_setting); //Opens new windowdocument_print.document.open(); document_print.document.write('<html><head><title>print using javascript</title></head>'); document_print.document.write('<body style="font-family:verdana; font-size:12px;" onLoad="self.print();self.close();" >'); document_print.document.write(content_innerhtml); document_print.document.write('</body></html>'); //does not show as a table, rather a a single rowdocument_print.print(); document_print.document.close(); Any ideas how I can do this?Thanks.
×
×
  • Create New...