Tutorial :ExecWB Print Preview Sometimes shows blank pages



Question:

This is a weird one. I am using the ExecWB method to create a PrintPreview window. Most of the time the print preview appears correctly. But sometimes it shows a blank page and that is all. Has anyone seen this before? The problem appears to be isolated to IE6. The problem is very hit and miss so it is difficult to determine what is going wrong.

 function onBodyLoad() {      if (document.getElementById("contentPanel") != null) {          var editCloseCell = document.getElementById('editCloseCell');          editCloseCell.style.visibility = "hidden";              var OLECMDID = 7; // 7 == Print Preview          var PROMPT = 1; // 2 == DONTPROMPTUSER            document.getElementById('webBrowser').ExecWB(OLECMDID, PROMPT);          editCloseCell.style.visibility = "visible";  

The 'webBroswer' element is an object. The contents of the control seem to be displaying correctly. Could it be that the execWB method is being called before the control is populated??

Any insite on this would be helpful.

Thanks!


Solution:1

The problem appears to be JQuery.. believe it or not. On the same page where I am using the ExecWB() method I am also including the JQuery library to do some non-related POSTS to my webservice. I tried removing the JQuery from this page and it seems to have fixed the issue. My first thought was that there must be some conflict with the $. So I included the jQuery.noConflicts() and changed my POST method to jQuery.Ajax. The same issue arises. So I reluctantly had to remove my JQuery reference and refactor the Ajax call. IE6 is not cool... not cool at all.


Solution:2

I have noticed that zooming seems to fix the preview. I wonder if anyone has seen this?


Solution:3

If I let the preview window sit there for about 10 minutes... it will eventually render the preview. Sometimes I am only previewing 2 pages?! Anyone? Am I the only sucker trying to use this?


Solution:4

Since the thread seems to be open and not resolved...

I got the same problem with print preview showing empty grey pages when i use asynchronous winint-calls (HttpSendRequestEx ()) at some other point in our desktop-application. After waiting some time the preview works again. Till about a year ago zooming the preview did help.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »