IE7 Print preview on page causes page count to continually increase
- Hi,
I'm experiencing a very odd issue on a site I'm working on in IE7 (site has elements of old ASP code) where-by when you go to print preview on certain pages (such as the link below), the page count at the bottom of the screen e.g. 1 of x, the X figure is constantly being incremented.
Anyone have any idea of whats going on??
http://www.limitedcompanyregistrations.co.uk/2-cpnynm.asp
All Replies
- This is a bug in IE's print preview implementation. I spent days trying to figure out why it happened, but print preview is implemented by a few thousand lines of JScript and I just couldn't figure it out. I did some cleanup in IE7 that we thought improved it a bit--this is the first I've heard of it still happening, but I've also been out of the loop. I don't think there is anything you can do to fix it, unless you own the site in question you can try changing it until it stops happening. It would be interesting to know if you can find a specific element or script or something that causes it to happen. It would also be interesting to know if it happens on all machines you use or just one specific one. When I visit the URL, e.g., it doesn't happen for me. Anyway, yeah, sorry about that. I didn't write it; I just tried to fix it once. Maybe use firefox instead for that page?
I am having this same issue with a page I designed. Thought maybe it had something to do with my code, but I validated my code and it passed with no errors or warnings. One thing I noticed is that it happens only when I have more than 1 page to print. If my print preview is only 1 page it works fine, but if it spand to more than 1 page the count is a seemly endless. I let it run and the count got as high as 4,000+ before I decided just cancel it.
I'm thinking it has to do with my CSS, but my CSS validates correctly.
It all works fine in Firefox, but that is not a feasible option. Many of the users use IE, so I need to get this fixed in IE.
- The only thing I can think of is try commenting out various elements and scripty things on your page until the problem goes away. If you can narrow it done to a specific HTML element or JScript function or variable or something I may be able to help.
I research the problem on various place around the web and one common thing I read is the use of DIVs and CSS. I'm going to try to recreate the page using only HTML with tables instead of DIVs and no CSS. My only issue with this is that if this is the case, it would case me to rewrite much of my code. I'll post my findings.
- I believe I've narrowed down this issue a bit. I have a page, that will cause this problem on any machine. I have a Show/Hide javascript function that when the text is hidden, there is no problem, but when it is not hidden, the print preview has this problem. If you want to get the source that is causing this issue, please let me know. The classic ASP page is using CSS and also uses nested DIV and Label tags. I have a table like structure implemented with the Div elements, and the label "For" attributes are blank. It seems that it does not matter which div I comment out, but if I comment out enough of them, the print preview works correctly, which would explain the hide function allowing the preview to work as well. So, it seems like the issue is related to the number and size of the div elements in the page. I have the html file the css file that should go along with this to make the page appear. The CSS file and the html are too large to be posted here. If you want them please reply with details for me to contact you or email me directly.
A note on that: I removed the CSS file form the html reference, and though the page looks like garbage, the print preview works fine. Unfortunately, the CSS has some formatting in it that causes the print preview logic to infinately loop.
Good Luck helping me with this! Thanks for Trying! - Hi Maxx57,
I am experiencing the same problem since last 3 days. my customer escalated this issue. Can you please mail me the solution on vaishalijain7@rediffmail.com. It's urgent.
Thanks! I don't have a solution to this, but rather a work around. I ended up using a table in a larger div element. There is still an issue with the print preview displaying it weird when the table has large rows, but it works fine with the number of rows my client will be adding.
- I have the same problem, thanks for the workaround maxx57
- I am finding the problem causing this is coming from my print.css file. I'll update my fix asap.
I'm still not sure exactly what the problem was. I ahd an iframe with a javascript calendar inside it. The styling had something to do with it. I'm not ahving the problem now. - If anyone has an URL that I can hit that consistently reproduces this bug, I can bring it to the attention of the appropriate developers.
- Unfortunately my site is internal.
- I have the original code, but it does not seem to be an issue anymore (with Windows 7 at least, I tested it with IE version 8.0.7100.0). Though the original problem came from an earlier version of IE 8. I'll see if I can reproduce it with the original code. (I hope it's the original! maybe I changed it when trying to work around it... I hope not!)


