Reputation: 118
When using apache FOP to generate the document, I want to add the extra empty row to fill the body-region
. As the second picture below, the content of table 2
is always on the same page (using keep-together.within-page="always"
property), the space on the page 1 is not enough for table 2
, so this table is rendered on page 2. Therefore, in pgae 1, I want to insert an empty row to the end of the body-region
, and on page 2 - last page, table 1
is added the constant number of empty rows (in this case is 13) before the table 2
. How to I do that?
Pic1: table 1 and empty row added
Pic2: table 1 empty row and table 2
Upvotes: 0
Views: 396
Reputation: 8068
You can't, in general, tell a table to make enough rows to fill a space. The formatter formats what's in its input, and it won't add table rows that aren't in the input. If you were using the XSLT Extensions from the Print and Page Layout Community Group, then you could work out the size of the real rows and then also generate the empty rows needed to give the effect that you want, but that's about the only way.
The usual way to fake something like what you want is to use a background image from one of the page regions for the table cell borders. If you can get by without the horizontal borders on empty rows, then the image could be just the column borders, and the table cells (or fo:table-row
) for the real rows could generate their own horizontal borders.
If you need the horizontal borders on the empty rows in the background image, then the real rows would have to have a white background to stop the horizontal borders from the background image being visible. You probably need to take care that the real rows are always an integer multiple of the height of the empty rows in the background image so that you don't appear to have an extra tall or short row immediately after the real rows.
You can put 'table 2' at the bottom of the page either by floating it to the bottom (which FOP can't do IIRC) or by including 'table 2' in the fo:static-content
for the fo:region-after
of the last page. That requires both that the page with 'table 2' is the last page of its page sequence and that you set up an fo:page-sequence-master
that selects the correct fo:simple-page-master
for page-position="last"
so that the fo:static-content
that contains 'table 2' is used on the last page.
Upvotes: 1