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 Johannes Wolfgang Woger <wo...@syslog.at> on 2004/11/29 14:39:09 UTC

How to set column-width dynamically

Hallo, 

I am using FOP with JSP pages. I have one printTable.jsp page that fits
almost all

Table representations. It therefore does not know the row count and the

Column count in advance.

I would like to make a printTableFO.jsp with the same dynamic elements.

 

How can I set column-width dynamic 

<fo:table-column
column-width="proportional-column-width('${calculatedWidth}')">

Does not work.

Can any values of FOP attributes be set dynamically?

 

            Wolfgang


RE: How to set column-width dynamically

Posted by "Andreas L. Delmelle" <a_...@pandora.be>.
> -----Original Message-----
> From: Andreas L. Delmelle [mailto:a_l.delmelle@pandora.be]
> > -----Original Message-----
> > From: Johannes Wolfgang Woger [mailto:wolfgang.woger@syslog.at]
> 

Hi,

Slight addition/correction:
> No, in the sense that an XSL-FO fed to FOP --so at the moment when it's
> purely an XML document in the XSL-FO namespace-- can contain only fixed
> values...

'fixed' is somewhat misleading, as the value can also be an expression.

see: http://www.w3.org/TR/xsl/slice5.html#section-N6961-Expressions

for more info.

Greetz,

Andreas

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


RE: How to set column-width dynamically

Posted by "Andreas L. Delmelle" <a_...@pandora.be>.
> -----Original Message-----
> From: Johannes Wolfgang Woger [mailto:wolfgang.woger@syslog.at]


Hi,

<snip />
> How can I set column-width dynamic
> <fo:table-column column-width="
proportional-column-width('${calculatedWidth}')">
> Does not work.
> Can any values of FOP attributes be set dynamically?

Well, to this last question...

No, in the sense that an XSL-FO fed to FOP --so at the moment when it's
purely an XML document in the XSL-FO namespace-- can contain only fixed
values...

So, in your case, you need to make sure that what FOP gets as input is, for
example an element like:

<fo:table-column column-width="proportional-column-width(2)" />

All resolving of the 'calculatedWidth' variable needs to be done *before*
FOP tries to interpret the property value. This can be done by javascript,
or as it was designed to be, in the XSLT stage: somewhere in the stylesheet
you use to transform the source XML into XSL-FO.

Hope this explains it adequately (if not, just yell :-) )

Greetz,

Andreas



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