You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by "de Leon, Raul" <rd...@microstrategy.com> on 2001/05/14 21:18:23 UTC

trying to break table by columns

I am new on this list, Hi everyone!

I have an issue with big tables and was wondering if anyone has any ideas.

My problem comes when I have a table with many columns that cannot fit into
one page. For example, in a table like the following:
---------------
| X | Y | Z |
--------------
| 1 | 2 | 3 |
--------------

I would like to have 2 columns per page so that it will look like this:

page 1:
----------
| X | Y |
----------
| 1 | 2 |
----------

page 2:

------
| Z |
-----
| 3 |
------

I have tried to use break-before on the column, but it didn't work. The only
solution I have come up with is to create multiple tables, but I think that
it will be hard to implement in XSL because the XML is a bit complicated.

Any help will be greatly appreciated,

Raul de Leon.

ps: my .fo file looks like this:

<?xml version="1.0" encoding="UTF-8" ?> 
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
	<fo:simple-page-master margin-right="0.75in" margin-left="0.75in"
margin-bottom="0.5in" margin-top="0.5in" master-name="main"
page-height="11in" page-width="8.5in">
	<fo:region-before extent="15mm" /> 
	<fo:region-body margin-top="10mm" margin-bottom="15mm" /> 
	<fo:region-after extent="10mm" /> 
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-name="main">
<fo:static-content flow-name="xsl-region-before">
	<fo:block space-after="1cm" text-decoration="underline"
font-weight="bold" font-size="14pt" text-align-last="center">Report
1</fo:block> 
</fo:static-content>
<fo:static-content flow-name="xsl-region-after">
	<fo:block font-size="10pt" text-align-last="center">
		Page 
		<fo:page-number /> 
	</fo:block>
</fo:static-content>
<fo:flow flow-name="xsl-region-body">
	<fo:table space-before.optimum="20pt">
		<fo:table-column column-width="3in" /> 
		<fo:table-column column-width="3in" />		
		<fo:table-column column-width="3in" />  
		<fo:table-header>
			<fo:table-row>
				<fo:table-cell border-width="0.5pt"
border-style="solid" border-color="silver" number-columns-spanned="1">
					<fo:block font-family="serif"
text-align="center" font-size="10pt" line-height="14pt">x</fo:block> 
				</fo:table-cell>
				<fo:table-cell border-width="0.5pt"
border-style="solid" border-color="silver" number-columns-spanned="1">
					<fo:block font-family="serif"
text-align="center" font-size="10pt" line-height="14pt" >y</fo:block> 
				</fo:table-cell>
				<fo:table-cell border-width="0.5pt"
border-style="solid" border-color="silver" number-columns-spanned="1">
					<fo:block font-family="serif"
text-align="center" font-size="10pt" line-height="14pt" >z</fo:block> 
				</fo:table-cell>
			</fo:table-row>
			</fo:table-header>
		<fo:table-body>
			<fo:table-row>
				<fo:table-cell border-width="0.5pt"
border-style="solid" border-color="silver" number-columns-spanned="1">
					<fo:block start-indent="1mm"
text-align="start" font-family="serif" font-size="10pt"
line-height="14pt">1</fo:block> 
				</fo:table-cell>
				<fo:table-cell border-width="0.5pt"
border-style="solid" border-color="silver">
					<fo:block text-align="end"
font-family="serif" font-size="10pt" line-height="14pt">2</fo:block> 
				</fo:table-cell>
				<fo:table-cell border-width="0.5pt"
border-style="solid" border-color="silver">
					<fo:block text-align="end"
font-family="serif" font-size="10pt" line-height="14pt">3</fo:block> 
				</fo:table-cell>		
			</fo:table-row>	
		</fo:table-body>
	</fo:table>
</fo:flow>
</fo:page-sequence>
</fo:root>








Re: trying to break table by columns

Posted by Karen Lease <kl...@club-internet.fr>.
Hi there,

Sorry but there is no concept of breaking between columns in XSL-FO (at
least not in version 1.0). Could you live with landscape pages so that
the whole table would fit? Otherwise the only solution is to try to do
it in the XSL. If you do that, you will probably want to use a break
before on each "part" of the the table to make sure that the parts line
up.

Good luck,
Karen

> "de Leon, Raul" wrote:
> 
> I am new on this list, Hi everyone!
> 
> I have an issue with big tables and was wondering if anyone has any
> ideas.
> 
> My problem comes when I have a table with many columns that cannot fit
> into one page. For example, in a table like the following:
> 
> ---------------
> | X | Y | Z |
> --------------
> | 1 | 2 | 3 |
> --------------
> 
> I would like to have 2 columns per page so that it will look like
> this:
> 
> page 1:
> ----------
> | X | Y |
> ----------
> | 1 | 2 |
> ----------
> 
> page 2:
> 
> ------
> | Z |
> -----
> | 3 |
> ------
> 
> I have tried to use break-before on the column, but it didn't work.
> The only solution I have come up with is to create multiple tables,
> but I think that it will be hard to implement in XSL because the XML
> is a bit complicated.
> 
> Any help will be greatly appreciated,
> 
> Raul de Leon.
> 
> ps: my .fo file looks like this:
> 
> <?xml version="1.0" encoding="UTF-8" ?>
> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
> <fo:layout-master-set>
>         <fo:simple-page-master margin-right="0.75in"
> margin-left="0.75in" margin-bottom="0.5in" margin-top="0.5in"
> master-name="main" page-height="11in" page-width="8.5in">
> 
>         <fo:region-before extent="15mm" />
>         <fo:region-body margin-top="10mm" margin-bottom="15mm" />
>         <fo:region-after extent="10mm" />
> </fo:simple-page-master>
> </fo:layout-master-set>
> <fo:page-sequence master-name="main">
> <fo:static-content flow-name="xsl-region-before">
>         <fo:block space-after="1cm" text-decoration="underline"
> font-weight="bold" font-size="14pt" text-align-last="center">Report
> 1</fo:block>
> 
> </fo:static-content>
> <fo:static-content flow-name="xsl-region-after">
>         <fo:block font-size="10pt" text-align-last="center">
>                 Page
>                 <fo:page-number />
>         </fo:block>
> </fo:static-content>
> <fo:flow flow-name="xsl-region-body">
>         <fo:table space-before.optimum="20pt">
>                 <fo:table-column column-width="3in" />
>                 <fo:table-column column-width="3in" />
>                 <fo:table-column column-width="3in" />
>                 <fo:table-header>
>                         <fo:table-row>
>                                 <fo:table-cell border-width="0.5pt"
> border-style="solid" border-color="silver" number-columns-spanned="1">
> 
>                                         <fo:block font-family="serif"
> text-align="center" font-size="10pt" line-height="14pt">x</fo:block>
> 
>                                 </fo:table-cell>
>                                 <fo:table-cell border-width="0.5pt"
> border-style="solid" border-color="silver" number-columns-spanned="1">
> 
>                                         <fo:block font-family="serif"
> text-align="center" font-size="10pt" line-height="14pt" >y</fo:block>
> 
>                                 </fo:table-cell>
>                                 <fo:table-cell border-width="0.5pt"
> border-style="solid" border-color="silver" number-columns-spanned="1">
> 
>                                         <fo:block font-family="serif"
> text-align="center" font-size="10pt" line-height="14pt" >z</fo:block>
> 
>                                 </fo:table-cell>
>                         </fo:table-row>
>                         </fo:table-header>
>                 <fo:table-body>
>                         <fo:table-row>
>                                 <fo:table-cell border-width="0.5pt"
> border-style="solid" border-color="silver" number-columns-spanned="1">
> 
>                                         <fo:block start-indent="1mm"
> text-align="start" font-family="serif" font-size="10pt"
> line-height="14pt">1</fo:block>
> 
>                                 </fo:table-cell>
>                                 <fo:table-cell border-width="0.5pt"
> border-style="solid" border-color="silver">
>                                         <fo:block text-align="end"
> font-family="serif" font-size="10pt" line-height="14pt">2</fo:block>
> 
>                                 </fo:table-cell>
>                                 <fo:table-cell border-width="0.5pt"
> border-style="solid" border-color="silver">
>                                         <fo:block text-align="end"
> font-family="serif" font-size="10pt" line-height="14pt">3</fo:block>
> 
>                                 </fo:table-cell>
>                         </fo:table-row>
>                 </fo:table-body>
>         </fo:table>
> </fo:flow>
> </fo:page-sequence>
> </fo:root>

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org