xslt - XSL: How can I limit table output to one page -
i have business requirement rendering table data in pdf. requirement contents of table must not exceed 1 page including header/footer. each row of table can vary in height it's not simple limiting number of rows output. how works table contents spill on many pages needed render table.
does know how can limit output of table 1 page? btw, pretty new xsl , xsl-fo.
thank much!
without stating want explicitly, if wish cut off overflow have several ways. since 1 page, not bother doing header/footer regions @ all. place content in absolutely positioned block-containers size wish.
for "middle" one, put table inside block-container , set overflow="hidden" on it.
i tested both renderx xep , apache fop, works perfect clip off overflow.
like this:
<fo:page-sequence master-reference="first"> <fo:flow flow-name="xsl-region-body"> <fo:block-container position="absolute" top="3in" left="1in" height="1in" width="7in" overflow="hidden" border="1pt solid black"> <fo:block> <fo:table border="solid 1pt blue"> <fo:table-column column-number="1" column-width="1.25in"/> <fo:table-column column-number="2" column-width="3in"/> <fo:table-body> <fo:table-row border="solid 1pt red"> <fo:table-cell > <fo:block>1.25in</fo:block> </fo:table-cell> <fo:table-cell> <fo:block>3in</fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell> <fo:block>1.25in</fo:block> </fo:table-cell> <fo:table-cell> <fo:block>3in</fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell> <fo:block>1.25in</fo:block> </fo:table-cell> <fo:table-cell> <fo:block>3in</fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell> <fo:block>1.25in</fo:block> </fo:table-cell> <fo:table-cell> <fo:block>3in</fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell> <fo:block>1.25in</fo:block> </fo:table-cell> <fo:table-cell> <fo:block>3in</fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell> <fo:block>1.25in</fo:block> </fo:table-cell> <fo:table-cell> <fo:block>3in</fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell> <fo:block>1.25in</fo:block> </fo:table-cell> <fo:table-cell> <fo:block>3in</fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell> <fo:block>1.25in</fo:block> </fo:table-cell> <fo:table-cell> <fo:block>3in</fo:block> </fo:table-cell> </fo:table-row> <fo:table-row> <fo:table-cell> <fo:block>1.25in</fo:block> </fo:table-cell> <fo:table-cell> <fo:block>3in</fo:block> </fo:table-cell> </fo:table-row> </fo:table-body> </fo:table> </fo:block> </fo:block-container> </fo:flow> </fo:page-sequence>
Comments
Post a Comment