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 Pascal Sancho <ps...@gmail.com> on 2015/02/09 16:42:02 UTC

Re: Fixing the table height

hi,

For such question please ask on FOP-users list, FOP-dev list is for
internal dev.

That said, for minimum table height, you should set it on a table-row:
<fo:table table-layout="fixed" width="100%" border="solid red 1pt">
  <fo:table-column column-width="proportional-column-width(1)"/>
  <fo:table-body>
    <fo:table-row block-progression-dimension.minimum="1cm">
      <fo:table-cell>
        <fo:block/>
      </fo:table-cell>
    </fo:table-row>
  </fo:table-body>
</fo:table>

Note that the message you get has nothing to do with table height; it
is related to column count;
On the resulting table grid, you have more cells thant expected.
You should have a look on the resulting XSL-FO to find the issue.
XSLT cannot help here.



HTH,

2015-02-09 12:45 GMT+01:00 fop_ag <ni...@arisglobal.com>:
> I upgraded to fop 1.1 from 0.20.5. In older version the table height was
> fixed, but with newer fop version the height of table is limited to amount
> of rows available. I'm using the xsl code provided in attached file -
>
> xsl_sample.txt
> <http://apache-fop.1065347.n5.nabble.com/file/n41697/xsl_sample.txt>
>
> I tried to move the <fo:table-row height="5mm"> after the creation of
> <fo:table-body>, but its giving the following exception -
>
> The column-number or number of cells in the row overflows the number of
> fo:table-columns specified for the table. (See fo:table-row,
> "???????(39994080, ???????????(, ...")
>
>
> Is there any way to have a table of fixed length of 5mm, so that even when
> there is no data, the table should always be of same height.
>
> Thank You.
>
>
>
> --
> View this message in context: http://apache-fop.1065347.n5.nabble.com/Fixing-the-table-height-tp41697.html
> Sent from the FOP - Dev mailing list archive at Nabble.com.



-- 
pascal

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


Re: Fixing the table height

Posted by fop_ag <ni...@arisglobal.com>.
Hi,

I'm facing one more problem now.
I've put some content in table footer, but that footer data is not getting
printed at the end of report, instead the footer gets displayed immediately
after the table row data gets ended.

this is the xsl snippet

      <fo:table table-layout="fixed" font-family="MS Gothic"
font-size="8pt">
            <fo:table-column column-width="50mm"/>
            <fo:table-column column-width="10mm"/>
            <fo:table-column column-width="130mm"/>
            <fo:table-header>
                 -- header rows
</fo:table-header>
<fo:table-footer>
--footer rows
</fo:table-footer>
<fo:table-body>
              <fo:table-row height="205mm">
.......

i'm observing this issue only with new fop 1.1 version, in older version it
was working fine.



--
View this message in context: http://apache-fop.1065347.n5.nabble.com/Re-Fixing-the-table-height-tp41699p41793.html
Sent from the FOP - Users mailing list archive at Nabble.com.

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


Re: Fixing the table height

Posted by Pascal Sancho <ps...@gmail.com>.
fingers too big ...
That said, I'm not sure that fixed table height will be implemented in
short-term; the main question is: how distribute remaining vertical
space between rows.


2015-02-17 8:47 GMT+01:00 Pascal Sancho <ps...@gmail.com>:
> Hi,
>
> generally speaking, FOP prior 0.9x was widely buggy, regarding
> block-progression-dimension (AKA height) related things. Current FOP
> versions (since refactoring started with 0.9x) gives expected results.
> In addition, older versions didn't fully respect XSL-FO
> recommendations. So you'll get substantial benefits upgrading FOP 0.2x
> to latest release (currently 1.1).
>
> 2015-02-16 14:05 GMT+01:00 fop_ag <ni...@arisglobal.com>:
>> Hi Pascal,
>>
>> Will check this solution..
>> But one doubt , y with newer fop version it stopped working in expected way
>> ?
>> In older version it was working properly..
>>
>>
>>
>> --
>> View this message in context: http://apache-fop.1065347.n5.nabble.com/Re-Fixing-the-table-height-tp41699p41772.html
>> Sent from the FOP - Users mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
>> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>>
>
>
>
> --
> pascal



-- 
pascal

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


Re: Fixing the table height

Posted by Pascal Sancho <ps...@gmail.com>.
Hi,

generally speaking, FOP prior 0.9x was widely buggy, regarding
block-progression-dimension (AKA height) related things. Current FOP
versions (since refactoring started with 0.9x) gives expected results.
In addition, older versions didn't fully respect XSL-FO
recommendations. So you'll get substantial benefits upgrading FOP 0.2x
to latest release (currently 1.1).

2015-02-16 14:05 GMT+01:00 fop_ag <ni...@arisglobal.com>:
> Hi Pascal,
>
> Will check this solution..
> But one doubt , y with newer fop version it stopped working in expected way
> ?
> In older version it was working properly..
>
>
>
> --
> View this message in context: http://apache-fop.1065347.n5.nabble.com/Re-Fixing-the-table-height-tp41699p41772.html
> Sent from the FOP - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>



-- 
pascal

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


Re: Fixing the table height

Posted by fop_ag <ni...@arisglobal.com>.
Hi Pascal,

Will check this solution.. 
But one doubt , y with newer fop version it stopped working in expected way
?
In older version it was working properly..



--
View this message in context: http://apache-fop.1065347.n5.nabble.com/Re-Fixing-the-table-height-tp41699p41772.html
Sent from the FOP - Users mailing list archive at Nabble.com.

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


Re: Fixing the table height

Posted by Pascal Sancho <ps...@gmail.com>.
Hi,
I understand now what you want.
For that, you need to set row height.

This can be computed at XSLT stage:
<xsl:variable name="rowHeigh"
    value="concat($availableHeight div count($myInputData/row), 'pt')"/>
...
<fo:row height="{$rowHeigh}">
    ...
</fo:row>

2015-02-16 6:14 GMT+01:00 fop_ag <ni...@arisglobal.com>:
> Hi,
>
> I've attached a snapshot which gives pictorial representation of the
> problem.
>
> problem.jpg
> <http://apache-fop.1065347.n5.nabble.com/file/n41769/problem.jpg>
>
>
>
> --
> View this message in context: http://apache-fop.1065347.n5.nabble.com/Re-Fixing-the-table-height-tp41699p41769.html
> Sent from the FOP - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>



-- 
pascal

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


Re: Fixing the table height

Posted by fop_ag <ni...@arisglobal.com>.
Hi, 

I've attached a snapshot which gives pictorial representation of the
problem. 

problem.jpg
<http://apache-fop.1065347.n5.nabble.com/file/n41769/problem.jpg>  



--
View this message in context: http://apache-fop.1065347.n5.nabble.com/Re-Fixing-the-table-height-tp41699p41769.html
Sent from the FOP - Users mailing list archive at Nabble.com.

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


Re: Fixing the table height

Posted by fop_ag <ni...@arisglobal.com>.
Hi,

I've attached a snapshot which gives pictorial representation of the
problem.

Image File :  problem.jpg
<http://apache-fop.1065347.n5.nabble.com/file/n41755/problem.jpg>  

<http://apache-fop.1065347.n5.nabble.com/file/n41755/problem.jpg> 





--
View this message in context: http://apache-fop.1065347.n5.nabble.com/Re-Fixing-the-table-height-tp41699p41755.html
Sent from the FOP - Users mailing list archive at Nabble.com.

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


Re: Fixing the table height

Posted by Pascal Sancho <ps...@gmail.com>.
My mistake,

I was talking about space-before and space-after properties, with are
composite too (.minimum, .maximum, and .optimum)

2015-02-12 13:58 GMT+01:00 Pascal Sancho <ps...@gmail.com>:
> that can be achieved playing with block-progression-dimension.minimum,
> b-p-d.optimum, and b-p-d.maximum properties.




-- 
pascal

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


Re: Fixing the table height

Posted by Pascal Sancho <ps...@gmail.com>.
IIUC, you want to distribute vertical space between some blocks?

If this is the case, you don't need fo:table anymore.
As suggested, use a fo:block-container having fixed height; then
inside use any king of block-objetcts, with "elastic spacing"; that
can be achieved playing with block-progression-dimension.minimum,
b-p-d.optimum, and b-p-d.maximum properties.

There is also a new extension comming with FOP next, allowing
alternate content, depending on remaining white-space.

Those 2 features (elastic spacing, alternate content) should meet your
wishes, perhaps.

2015-02-12 12:43 GMT+01:00 fop_ag <ni...@arisglobal.com>:
> Hi Luis,
>
> Yes i wanted to have a table of fixed height, so that irrespective of no of
> rows that is present within that table the height should be same.
>
> If a  table has capacity to accomadate 10 rows of data, with old fop if
> there were only 5 rows existed table height would remain constant, but with
> newer fop the table height is not constant, entire table looks like
> collapsed.
>
>
>
> --
> View this message in context: http://apache-fop.1065347.n5.nabble.com/Re-Fixing-the-table-height-tp41699p41746.html
> Sent from the FOP - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>



-- 
pascal

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


Re: Fixing the table height

Posted by fop_ag <ni...@arisglobal.com>.
Hi Luis,

Yes i wanted to have a table of fixed height, so that irrespective of no of
rows that is present within that table the height should be same.

If a  table has capacity to accomadate 10 rows of data, with old fop if
there were only 5 rows existed table height would remain constant, but with
newer fop the table height is not constant, entire table looks like
collapsed.



--
View this message in context: http://apache-fop.1065347.n5.nabble.com/Re-Fixing-the-table-height-tp41699p41746.html
Sent from the FOP - Users mailing list archive at Nabble.com.

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


Re: Fixing the table height

Posted by Luis Bernardo <lm...@gmail.com>.
The suggestion given was to keep the row height fixed. Obviously the 
table height will be a multiple then of the number of rows.

You have not explained well what you are trying to achieve. You want a 
fixed table height regardless of the number of rows and their height?

Can you provide a drawing of what you expect, or maybe a document 
generated with the older FOP version you were using?

On 2/12/15 10:26 AM, fop_ag wrote:
> Hi Luis Bernardo,
>
> Even having block-container inside the table cell didnt give the expected
> result.. Still the height is growing depending on total no of rows in table.
>
> Here is the xsl snippet which i used -
>
> <fo:table-row height="3mm">
>                                <fo:table-cell padding="1mm"
> padding-top="0.5mm" padding-bottom="0.5mm">
>                                <fo:block-container border="solid red 1pt"
>      								block-progression-dimension.minimum="1cm"
>      								inline-progression-dimension="100%">
>                                  <fo:block hyphenate="true"
> wrap-option="wrap"  white-space-collapse="false"
> white-space-treatment="preserve" linefeed-treatment="preserve"
>> <xsl:value-of select="B.4.k.2.1"/></fo:block>
> </fo:block-container>
> </fo:table-cell>
> </fo:table-row>
>
>
>
> --
> View this message in context: http://apache-fop.1065347.n5.nabble.com/Re-Fixing-the-table-height-tp41699p41744.html
> Sent from the FOP - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>


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


Re: Fixing the table height

Posted by fop_ag <ni...@arisglobal.com>.
Hi Luis Bernardo,

Even having block-container inside the table cell didnt give the expected
result.. Still the height is growing depending on total no of rows in table.

Here is the xsl snippet which i used - 

<fo:table-row height="3mm">
                              <fo:table-cell padding="1mm"
padding-top="0.5mm" padding-bottom="0.5mm">
                              <fo:block-container border="solid red 1pt" 
    								block-progression-dimension.minimum="1cm" 
    								inline-progression-dimension="100%">
                                <fo:block hyphenate="true"
wrap-option="wrap"  white-space-collapse="false"
white-space-treatment="preserve" linefeed-treatment="preserve"
><xsl:value-of select="B.4.k.2.1"/></fo:block>
</fo:block-container>
</fo:table-cell>
</fo:table-row>



--
View this message in context: http://apache-fop.1065347.n5.nabble.com/Re-Fixing-the-table-height-tp41699p41744.html
Sent from the FOP - Users mailing list archive at Nabble.com.

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


Re: Fixing the table height

Posted by Luis Bernardo <lm...@gmail.com>.
I think the desired behavior is to have rows of fixed height. Having a 
block-container with fixed height inside a table-cell should achieve the 
desired result.

On 2/10/15 5:20 PM, Pascal Sancho wrote:
> Hi,
>
> FOP 1.1 only accepts value "auto" for fo:table@height.
> Other values are replaced with 'auto'.
> If you want a frame with a fixed (or minimal) height, then embed your
> table in an fo:block-containter:
> <fo:block-container
>      border="solid red 1pt"
>      block-progression-dimension.minimum="1cm"
>      inline-progression-dimension="100%"
>      <fo:table table-layout="fixed" width="100%">
>      ...
>      </fo:table>
> </fo:block-container>
>
> 2015-02-10 13:05 GMT+01:00 fop_ag <ni...@arisglobal.com>:
>> Hi,
>>
>> I'm trying to use the fo:block-container like u mentioned, but still the
>> table height is not constant..
>> It grows or shrinks depending on total no of rows in the table.
>>
>> THis is the xsl i used xsl_updated.txt
>> <http://apache-fop.1065347.n5.nabble.com/file/n41706/xsl_updated.txt>
>>
>>
>>
>> --
>> View this message in context: http://apache-fop.1065347.n5.nabble.com/Re-Fixing-the-table-height-tp41699p41706.html
>> Sent from the FOP - Users mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
>> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>>
>
>


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


Re: Fixing the table height

Posted by fop_ag <ni...@arisglobal.com>.
Hi,

Here is the xsl i used  -

xsl_updated.txt
<http://apache-fop.1065347.n5.nabble.com/file/n41742/xsl_updated.txt>  



--
View this message in context: http://apache-fop.1065347.n5.nabble.com/Re-Fixing-the-table-height-tp41699p41742.html
Sent from the FOP - Users mailing list archive at Nabble.com.

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


Re: Fixing the table height

Posted by Pascal Sancho <ps...@gmail.com>.
Hi,
link seems broken

plus, the best material in this list will be a short xsl-fo (not xlst)
demonstrating the issue.

2015-02-11 6:28 GMT+01:00 fop_ag <ni...@arisglobal.com>:
> Hi,
>
> I tried the same thing u told. Still same problem with the height.
> I'm attaching the snapshot of generated report.
>
> <http://apache-fop.1065347.n5.nabble.com/file/n41725/snapshot.jpg>
>
>
>
> --
> View this message in context: http://apache-fop.1065347.n5.nabble.com/Re-Fixing-the-table-height-tp41699p41725.html
> Sent from the FOP - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>



-- 
pascal

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


Re: Fixing the table height

Posted by fop_ag <ni...@arisglobal.com>.
Hi,

I tried the same thing u told. Still same problem with the height. 
I'm attaching the snapshot of generated report.

<http://apache-fop.1065347.n5.nabble.com/file/n41725/snapshot.jpg> 



--
View this message in context: http://apache-fop.1065347.n5.nabble.com/Re-Fixing-the-table-height-tp41699p41725.html
Sent from the FOP - Users mailing list archive at Nabble.com.

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


Re: Fixing the table height

Posted by Pascal Sancho <ps...@gmail.com>.
Hi,

FOP 1.1 only accepts value "auto" for fo:table@height.
Other values are replaced with 'auto'.
If you want a frame with a fixed (or minimal) height, then embed your
table in an fo:block-containter:
<fo:block-container
    border="solid red 1pt"
    block-progression-dimension.minimum="1cm"
    inline-progression-dimension="100%"
>
    <fo:table table-layout="fixed" width="100%">
    ...
    </fo:table>
</fo:block-container>

2015-02-10 13:05 GMT+01:00 fop_ag <ni...@arisglobal.com>:
> Hi,
>
> I'm trying to use the fo:block-container like u mentioned, but still the
> table height is not constant..
> It grows or shrinks depending on total no of rows in the table.
>
> THis is the xsl i used xsl_updated.txt
> <http://apache-fop.1065347.n5.nabble.com/file/n41706/xsl_updated.txt>
>
>
>
> --
> View this message in context: http://apache-fop.1065347.n5.nabble.com/Re-Fixing-the-table-height-tp41699p41706.html
> Sent from the FOP - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>



-- 
pascal

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


Re: Fixing the table height

Posted by fop_ag <ni...@arisglobal.com>.
Hi,

I'm trying to use the fo:block-container like u mentioned, but still the
table height is not constant.. 
It grows or shrinks depending on total no of rows in the table.

THis is the xsl i used xsl_updated.txt
<http://apache-fop.1065347.n5.nabble.com/file/n41706/xsl_updated.txt>  



--
View this message in context: http://apache-fop.1065347.n5.nabble.com/Re-Fixing-the-table-height-tp41699p41706.html
Sent from the FOP - Users mailing list archive at Nabble.com.

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


Re: Fixing the table height

Posted by Pascal Sancho <ps...@gmail.com>.
Hmm,

rather than use an fo:table to get a fixed height area, you should use
an fo:block-container.
Note that with modern FOP, such elements are handled in a better way
than the (very old) FOP 0.2.x.
Then, you can insert an fo:table in your fo:block-container if you lay
out tabular data.

2015-02-10 5:29 GMT+01:00 fop_ag <ni...@arisglobal.com>:
> Hi,
> The total no of columns defined is also proper,
> I'm getting the error after moving the <fo:table-row> inside <xsl:for-each>.
> If the <fo:table-row> is placed outside for-each tag i.e., after
> <fo:table-body> the report gets generated without any error. But the table
> height is not fixed in this case.
>
>
>
> --
> View this message in context: http://apache-fop.1065347.n5.nabble.com/Re-Fixing-the-table-height-tp41699p41700.html
> Sent from the FOP - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>



-- 
pascal

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


Re: Fixing the table height

Posted by fop_ag <ni...@arisglobal.com>.
Hi,
The total no of columns defined is also proper,
I'm getting the error after moving the <fo:table-row> inside <xsl:for-each>.
If the <fo:table-row> is placed outside for-each tag i.e., after
<fo:table-body> the report gets generated without any error. But the table
height is not fixed in this case.



--
View this message in context: http://apache-fop.1065347.n5.nabble.com/Re-Fixing-the-table-height-tp41699p41700.html
Sent from the FOP - Users mailing list archive at Nabble.com.

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