Groups > Design > Microsoft xsl > Re: Adding Page Break




Adding Page Break

Adding Page Break
Thu, 10 Apr 2008 06:31:17 -070
Hope somebody can answer this,  I am real new to this XSL stuff.  I
need to add a page break to a document after displaying a line of
data.  I went thru and scanned the forum and tried the page break
statement, but it does not seem to work. Would like to page break or
add a blank line.
Any Help would be greatly be appreicated.
Thanks
Terry
Code snippet:
.
.
 <tr class="actionitems">
                <td class="actionitems"><xsl:value-of
select="@DesignNumber"/></td>
                <td class="actionitems"><xsl:value-of
select="@CustSpec"/></td>
                <td class="actionitems"><xsl:value-of
select="@JobNumber"/></td>
                <td class="actionitems"><xsl:value-of
select="@OrdDate"/></td>
                <td class="actionitems"><xsl:value-of
select="@DueDate"/></td>
                <td class="actionitems"><xsl:value-of
select="@PONum"/
></td>
                <td class="actionitems"><xsl:value-of
select="@OrdDesc"/></td>
                <td class="actionitems"><xsl:value-of
select="@OrdQty"/
></td>
                <td class="actionitems"><xsl:value-of
select="@EarlyDueDate"/></td>
                <p style="page-break-after: always"></p>
              </tr>
Post Reply
Re: Adding Page Break
Thu, 10 Apr 2008 15:51:28 +020
Tambrosi wrote:
> Hope somebody can answer this,  I am real new to this XSL stuff.  I
> need to add a page break to a document after displaying a line of
> data.  I went thru and scanned the forum and tried the page break
> statement, but it does not seem to work. Would like to page break or
> add a blank line.

How you add a page break is not a question of XSLT. It solely depends on 
the result format you create with your XSLT. If you want to create a 
HTML document then all that you can use is CSS 2 page break properties 
<URL:http://www.w3.org/TR/CSS21/page.html#page-breaks> and hope that the 
browser supports them when printing your HTML document:
   <tr style="page-break-after: always;">


-- 

	Martin Honnen --- MVP XML
Post Reply
Re: Adding Page Break
Fri, 11 Apr 2008 04:45:51 -070
On Apr 10, 8:51 am, Martin Honnen <mahotr...@yahoo.de> wrote:
> Tambrosi wrote:
> > Hope somebody can answer this,  I am real new to this XSL stuff.  I
> > need to add a page break to a document after displaying a line of
> > data.  I went thru and scanned the forum and tried the page break
> > statement, but it does not seem to work. Would like to page break or
> > add a blank line.
>
> How you add a page break is not a question of XSLT. It solely depends on
> the result format you create with your XSLT. If you want to create a
> HTML document then all that you can use is CSS 2 page break properties
> <URL:http://www.w3.org/TR/CSS21/page.html#page-breaks> and hope that
the
> browser supports them when printing your HTML document:
>    <tr style="page-break-after: always;">
>
> --
>
>         Martin Honnen --- MVP XML
>        http://JavaScript.FAQTs.com/

Thanks for the info,
I tried the command <tr style="page-break-after: always;"> and
the
document did not page break.
How do you know if the broswer supports a page break.  Actually this
document is being opened in Outlook
and printed from there.  This is the full code set. Is there something
else that I need to change.

Or if I could just add a blank line to the document.  That would be
ok.
Any help would be appreciated.
Thanks
Terry

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/
Transform">
  <xsl:output method="html"/>
  <xsl:template match="Alert">
    <HTML>
      <head>
        <style type="text/css">
          h1 { font-family: tahoma; font-weight: bold; color: #ff0000;
font-size: 18pt}
          h2 { font-family: tahoma; font-weight: bold; font-size:
12pt}
          table { font-family: arial; font-size: 10pt }
          tr { background: #FFFFFF; border-size: 1; border-color:
#000000}
	  td { border-width: 1; border-style: solid; border-color: #000000 }
          td.actionitems { text-align: left; padding}
          td.heading { font-family: tahoma; font-weight: bold; text-
align: left}
          td.value { text-align: left; padding}
          </style>
      </head>
      <body>
         <h1>Alert: <xsl:value-of
select="AlertCondition/@name"/></h1>

        <h2>Alert Details</h2>
	 <table cellspacing="0" border="1"
cellpadding="3">

          <tr>
            <td class="heading">Assigned to:</td>
            <td class="value"><xsl:value-of
select="AlertCondition/
@assignedUser"/></td>
          </tr>
        </table>

      <h2>Address/Order Items</h2>
        <table cellspacing="0" border="1"
cellpadding="3">
          <xsl:for-each select="ActionItems">
            <xsl:for-each select="ActionItem">
              <tr class="actionitems">
                <td class="actionitems"><xsl:value-of
select="@CompName2"/></td>
              </tr>
              <tr class="actionitems">
                <td class="actionitems"><xsl:value-of
select="@CompStreet"/></td>
              </tr>
              <tr class="actionitems">
                <td class="actionitems"><xsl:value-of
select="@CompCity"/></td>
                <td class="actionitems"><xsl:value-of
select="@CompState"/></td>
                <td class="actionitems"><xsl:value-of
select="@CompZip"/></td>
              </tr>

              <tr>
                 <td class="heading">Product Design</td>
                 <td class="heading">Customer Spec</td>
                 <td class="heading">Job Number</td>
                 <td class="heading">Order Date</td>
                 <td class="heading">Due Date</td>
                 <td class="heading">P.O. Number</td>
                 <td class="heading">Order Desc</td>
                <td class="heading">Order Qty</td>
                <td class="heading">Earliest Date</td>
             </tr>

               <tr class="actionitems">
                <td class="actionitems"><xsl:value-of
select="@DesignNumber"/></td>
                <td class="actionitems"><xsl:value-of
select="@CustSpec"/></td>
                <td class="actionitems"><xsl:value-of
select="@JobNumber"/></td>
                <td class="actionitems"><xsl:value-of
select="@OrdDate"/></td>
                <td class="actionitems"><xsl:value-of
select="@DueDate"/></td>
                <td class="actionitems"><xsl:value-of
select="@PONum"/
></td>
                <td class="actionitems"><xsl:value-of
select="@OrdDesc"/></td>
                <td class="actionitems"><xsl:value-of
select="@OrdQty"/
></td>
                <td class="actionitems"><xsl:value-of
select="@EarlyDueDate"/></td>
                <tr class="actionitems">
                <td class="actionitems"><xsl:value-of
select="@SpaceCtrl"/></td>
                </tr>
                <tr class="actionitems">
                <td class="actionitems"><xsl:value-of
select="@SpaceCtrl"/></td>
                </tr>

              </tr>

              </xsl:for-each>

        </xsl:for-each>
        </table>
      </body>
    </HTML>
  </xsl:template>
Post Reply
Re: Adding Page Break
Fri, 11 Apr 2008 12:22:00 -070
On Apr 11, 6:58 am, Martin Honnen <mahotr...@yahoo.de> wrote:
> Tambrosi wrote:
> > I tried the command <tr style="page-break-after:
always;"> and the
> > document did not page break.
> > How do you know if the broswer supports a page break.  Actually this
> > document is being opened in Outlook
> > and printed from there.  
>
> I think Outlook simply uses IE (respectively the web browsesr control IE
> is based on). Try whether IE inserts a page break when you print with
> IE. According to MSDN there is support for page-break-after:
> <URL:http://msdn2.microsoft.com/en-us/library/ms530842(VS.85).aspx>
>
> --
>
>         Martin Honnen --- MVP XML
>        http://JavaScript.FAQTs.com/

I tried so many combinations and different things, and still could not
get a darn page break to work.
I cannot believe something that simple just does not work clean.
Thanks for the ideas and all.for
Post Reply
Re: Adding Page Break
Fri, 11 Apr 2008 13:58:56 +020
Tambrosi wrote:

> I tried the command <tr style="page-break-after: always;">
and the
> document did not page break.
> How do you know if the broswer supports a page break.  Actually this
> document is being opened in Outlook
> and printed from there.  

I think Outlook simply uses IE (respectively the web browsesr control IE 
is based on). Try whether IE inserts a page break when you print with 
IE. According to MSDN there is support for page-break-after: 
<URL:http://msdn2.microsoft.com/en-us/library/ms530842(VS.85).aspx>



-- 

	Martin Honnen --- MVP XML
Post Reply
about | contact