Ash
Ash

Reputation: 1298

Print and Print Preview missing data in IE8

In a specific screen I need to let the user print out some data. Due to the complexity of the data displayed, it is used a label:

lblTree.Text = stringHTML;

The tree is displayed using a dynamically constructed HTML string. The final string is 52 000 characters long. I don't think that is important, but I thought I would explain the background. In aspx, it looks like this:

<table border="0" cellpadding="0" cellspacing="0">
    <tr>
        <td colspan="3" align="left" class="PrintTBLHeader"><br />report as of 20/09/2012 : <br /><br /></td>
    </tr>
    <tr>
        <td colspan="3"><br /><asp:Label runat="server" ID="lblTree"></asp:Label><br /><br /></td>
    </tr>
    <tr>
        <td colspan="3" align="left" class="PrintTBLHeader"><br />2nd title:<br /><br /></td>
    </tr>
    <tr>
        <td colspan="3"><br /><asp:Label runat="server" ID="lblMPMtree"></asp:Label></td>
    </tr>
</table>

The problem is this: when I open the print preview, it should say 6 pages (like in firefox and chrome - those are working right), but this print preview from IE8 is showing me only 3 pages.

lblTree is cut at the end of the 1st page Then on the second page, instead of showing the rest of lblTree, it starts with the "2nd title" (tr #3 in the example above)

I found some article related to something like this, where the solution was adding media="print" to the <link>.

<link rel="stylesheet" type="text/css" href="..." media="print" />

That did not work.

Upvotes: 1

Views: 1737

Answers (1)

Henrik Ammer
Henrik Ammer

Reputation: 1899

To summarize:

  • Check the code if it's invalid to the DOCTYPE with the validator
  • If invalid, IE will render in quirksmode which is never a good thing.

Upvotes: 1

Related Questions