> -----Original Message-----
> From: James Earl [mailto:[EMAIL PROTECTED]
>

Hi James,

> Thanks for the example.
>
> vMax is a string length in this example though, right?  Correct me if
> I'm wrong, but I don't think proportional-column-width() will work with
> a string length will it?
>

Hmm.. Not sure what *exactly* you are referring to, but XSLT's
string-length() function returns a number, and that number is what gets fed
to the proportional-column-width() function.

Don't know if you have read up on the definition of
proportional-column-width(), but it works more or less as follows:

- first all other specified column-widths are resolved (explicitly set to an
absolute or a percentage value)
- the total of these is subtracted from the table-width
- then, for all remaining columns whose width is defined by p-c-w(), the
total of the numbers is made, and the remaining table-width is distributed
over these columns along the proportions that are specified

So, if you have two columns like this:
<fo:table-column column-width="proportional-column-width(1)" />
<fo:table-column column-width="proportional-column-width(5)" />

The second one will always be 5 times as wide as the first, no matter what
else...

Using string-length() is indeed a bit rudimentary, in that it can, strictly
speaking, only approach the actual text-width when a fixed-width font is
used further on. If you want to refine that, you would need to take into
account the font-metrics as well... Also, the proportions will only look
nice if you have all rows of the same height (meaning: no line-breaks inside
cells) Sure, this too can be compensated for.

Say you have a max record width (sum of all respective max field widths) of
65, then each column gets its width according to a calculation like

[( proportional-width / 65 ) * remaining-table-width ]

Other than that... could it be that you're a bit misled by the subtle
difference between XSLT and XSL-FO (?) The result of string-length() is
resolved long before FOP starts digesting the actual fo:table-column, so FOP
sees nothing of the string-length() function. That's the XSLT processor's
realm...



HTH!

Greetz,

Andreas


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to