You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Rita Greenberg <rg...@medata.com> on 2011/11/08 17:32:06 UTC

Problem With Keep Together

Hello.

I have 8 lines of payer information that I print on a PDF document.
I need these 8 lines to print together on the same page.
The first three lines must only print if a certain condition is met so I have 
them within a <xsl:if> and <xsl:block>.
The next 5 lines must only print if another condition is met and they are in 
another <xsl:if> and <xsl:block>.

I call a template that prints these 8 lines and in the template I try to get 
them to print all 8 lines on the same page. I tried adding "keep-with-next="1"" 
on all the <fo:table-row> lines but that didn't work. I then tried 
"keep-with-next="always"" to no avail.

I then tried the following code to encapsulate the 8 rows within two blocks but 
that didn't work either.
Code:
  <xsl:template name="tmpRequirements">
    <fo:block keep-with-next.within-page="always">
      <fo:block keep-together.within-page="always">
        <!-- PAYEE LINE -->
        <xsl:if test="EOB/ALLOWANCE &gt; 0>
          <fo:block padding-top=".2cm">
Here's where I call the template.
Code:
      <fo:block padding="0pt">
        <xsl:call-template name="tmpRequirements">
        </xsl:call-template>
      </fo:block>
I'm using FOP version 1.0.

One other thing I tried was to add two blocks with keep-with-next.within-
page="always" in the first block and
keep-together.within-page="always" in the second block as above, when calling 
the template. That didn't work either.

Any suggestions as to how to keep the 8 lines together on the same page will be 
greatly appreciated!

Thanks,
Rita


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Problem With Keep Together

Posted by Rita Greenberg <rg...@medata.com>.
Rita Greenberg <rgreenberg <at> medata.com> writes:
> 
> Hello.
> 
> I have 8 lines of payer information that I print on a PDF document.
> I need these 8 lines to print together on the same page.
> The first three lines must only print if a certain condition is met so I have 
> them within a <xsl:if> and <xsl:block>.
> The next 5 lines must only print if another condition is met and they are in 
> another <xsl:if> and <xsl:block>.

This is occurring in FOP 0.20.5 not FOP 1.0.
I've upgraded to FOP 1.0 but still have a couple of .fo files in FOP 0.20.5 
that need this change immediately.



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Problem With Keep Together

Posted by Rita Greenberg <rg...@medata.com>.
Christopher R. Maden <crism <at> maden.org> writes:

> The best approach to solving problems like this is to hand-tweak the
> XSL-FO and get that to work, first.  Then change your XSLT to generate
> that XSL-FO.  From your XSLT, it’s hard to tell exactly what’s going on,
> and the expertise on this list is focused on how FOP handles the XSL-FO
> directly.

Thanks Chris.

I was finally able to get it to work by using "keep-with-previous="always"" on 
table rows. I had to create a "holding" table and break up my xsl:if statement 
but this workaround did the trick!





---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Problem With Keep Together

Posted by "Christopher R. Maden" <cr...@maden.org>.
On 11/08/2011 11:32 AM, Rita Greenberg wrote:
> Any suggestions as to how to keep the 8 lines together on the same
> page will be greatly appreciated!

The best approach to solving problems like this is to hand-tweak the
XSL-FO and get that to work, first.  Then change your XSLT to generate
that XSL-FO.  From your XSLT, it’s hard to tell exactly what’s going on,
and the expertise on this list is focused on how FOP handles the XSL-FO
directly.

Offhand, it looks like the fo:block inside the xsl:if allows breaking.

~Chris
-- 
Chris Maden, text nerd  <URL: http://crism.maden.org/ >
“Be wary of great leaders.  Hope that there are many, many small
 leaders.” — Pete Seeger

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org