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 Juergen Lippold <jl...@unilog.de> on 2002/05/15 11:16:41 UTC
dynamic table-column-width
Hello,
does anybody know if there is a possibilty to let FOP-Managing the column-width?
The problem is that I've got some tables with String-attributes for each column with a different width.
There is one possibiltity to calculate the width in the java application, but I don't think that there will be very
good performance doing this because you have to check the length of all the Strings.
Thanks for help.
Juergen Lippold
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org
RE: dynamic table-column-width
Posted by Torsten Erler <er...@net-linx.de>.
Mistake discovered:
xml datasource should look like this
<table1>
<columns>
<width>10</width>
</columns>
<columns>
<width>15</width>
</columns>
<columns>
<width>30</width>
</columns>
</table1>
>snip...
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org
RE: dynamic table-column-width
Posted by Torsten Erler <er...@net-linx.de>.
I think you have to calculate the column-width in your java code and then
pass it to the xml or direct to the xslt transformer as parameter.
possibility 1:
create xml structure like this in your data source
<table1>
<columns>
<width>10</width>
<width>15</width>
<width>30</width>
</columns>
</table1>
in your xsl read out this values
<xsl:for-each select="table1/columns">
<fo:table-column column-width="proportional-column-width({@width})"/>
</xsl:for-each>
possibility 2:
pass the values to the stylesheet at transforming process
Transformer transformer = =
TransformerFactory.newInstance().newTransformer( xslSource );
transformer.setParameter( "table1-column1", yourValue1 );
transformer.setParameter( "table1-column2", yourValue2 );
...
in your xsl catch the parameters
<xsl:param name="table1-column1"/>
<xsl:param name="table1-column2"/>
and use it to set the columns
<fo:table-column
column-width="proportional-column-width({$table1-column1})"/>
<fo:table-column
column-width="proportional-column-width({$table1-column2})"/>
Note that all of this is untestet stuff and may not work.
cu Torsten
-----Original Message-----
From: Juergen Lippold [mailto:jlippold@unilog.de]
Sent: Mittwoch, 15. Mai 2002 11:17
To: >
Subject: dynamic table-column-width
Hello,
does anybody know if there is a possibilty to let FOP-Managing the
column-width?
The problem is that I've got some tables with String-attributes for each
column with a different width.
There is one possibiltity to calculate the width in the java application,
but I don't think that there will be very
good performance doing this because you have to check the length of all the
Strings.
Thanks for help.
Juergen Lippold
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org