Re: Printing in C#, need code to accomplish this
- From: "Kevin Spencer" <unclechutney@xxxxxxxxxxxx>
- Date: Tue, 31 Jul 2007 08:39:30 -0400
Hi Peter,
I'd love to see your CSS, because I haven't been able to get page-breaking
to work in IE 7. In my case, I've got HTML tables inside divs, one table
inside each div, and each div should have a page break before it, except for
the first page. I'm using an external style *** in the page header, rather
than an inline style, if that makes any difference.
Here's a sample (from the style ***):
@page following
{
page-break-after: auto;
page-break-before: always;
page-break-inside: avoid;
margin: auto;
}
@page first
{
page-break-after: always;
page-break-before: avoid;
page-break-inside: avoid;
}
....and some snippets of HTML:
<div id="first" style="page:first">
<div class="positioning" style="width:993px;">
<table class="tableHeader" cellpadding="0" cellspacing="0" style="
width:993px; color:#000000; background-color:; border-width:1px;
border-color:#000000;font-family:Microsoft Sans Serif; font-size:9pt;
font-weight:bold;">
<tr>
....
</tr>
</table>
</div>
</div>
<div style="width:993px; page:following">
....
Any ideas why these divs with tables in them are not breaking pages in IE 7?
As I mentioned, the breaks occur correctly in FireFox, after each div. I
also tried simply using an @page directive, with page-break-after: always;
and got the same results.
--
HTH,
Kevin Spencer
Microsoft MVP
Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net
"Peter Duniho" <NpOeStPeAdM@xxxxxxxxxxxxxxxx> wrote in message
news:13as44ikjhhq107@xxxxxxxxxxxxxxxxxxxxx
Kevin Spencer wrote:
You're going to have problems in a web application. There is a CSS
specification for printing, but it is not supported entirely well by any
browser. Page Breaks, for example, are not supported by Internet
Explorer, even version 7.
Can you clarify this? I use the "page-break-after" style for page breaks
in IE7 without any trouble. I'm pretty sure it worked in IE6 too, though
I haven't bothered to go back and check. I don't do a lot of HTML print
layout so I've never bothered to try the other page-break styles, but
given that "page-break-after" works, I suspect they do too.
Pete
.
- Follow-Ups:
- Re: Printing in C#, need code to accomplish this
- From: Peter Duniho
- Re: Printing in C#, need code to accomplish this
- References:
- Printing in C#, need code to accomplish this
- From: kalyan
- Re: Printing in C#, need code to accomplish this
- From: Peter Duniho
- Re: Printing in C#, need code to accomplish this
- From: kalyan
- Re: Printing in C#, need code to accomplish this
- From: Kevin Spencer
- Re: Printing in C#, need code to accomplish this
- From: Peter Duniho
- Printing in C#, need code to accomplish this
- Prev by Date: Re: Passing Back Table Information from Oracle .NET Stored Procedures
- Next by Date: Re: System.Security.Cryptography.CryptographicException; bug in .NET 1.1 ?
- Previous by thread: Re: Printing in C#, need code to accomplish this
- Next by thread: Re: Printing in C#, need code to accomplish this
- Index(es):