Forum OpenACS Q&A: Re: List builder and column widths of generated tables

Collapse
Posted by Jeff Davis on
template::multirow create colspec width

should create the colspec:rowcount variable so my guess is that this is not being called that or the template is not being evaled at adp_level. You could add a <%= [info locals] %> in place of your multiple loop just to see what variables are in fact defined.

also this:

template::multirow  append colspec width
should be:
template::multirow  append colspec $width
Collapse
Posted by Andrei Popov on
colspec:rowcount is indeed missing in <%= [info locals] %> output

I've tried to change as follows:

set colspec:rowcount 0
template::multirow create colspec width
foreach width $list_properties(colspec) {
    template::multirow append colspec $width
}
template::multirow -local -ulevel [expr $ulevel + 1] upvar colspec

but result is the same/similar: if I leave set colspec:rowcount I get colspec:rowcount already defined, if I comment it out, I get colspec:rowcount no such variable.

Playing with differnt values of -ulevel does not help either...

Collapse
Posted by Jeff Davis on
Are you sure the code is really being executed? You might want to put an ns_log statment in there. Also, an alternative (since it seems the list_properties.colspec var does wind it's way through) is to use the <list> tag to generate the colspec.

Out of curiousity, what are you using to xform html to fo (is it some standard xsl or something you wrote yourself)?

I have been using docbook-xsl and FOP to produce PDFs and have been ok with the output although I see a lot of shortcomings with FOP for realistic sized documents.

Collapse
Posted by Andrei Popov on
Yeah, code is being executed all right.  I had ns_log in there and -colspec gets read and if you call template::multirow size it returns 6 -- the number of rows in the created multirow!

I am using XHTML2FO XSL stylesheet as picked up from Antenna House website here: http://www.antennahouse.com/XSLsample/XSLsample.htm

Works very well.  What I do is a bit of a hack, really: I fetch (rather wget) the page, pass it through tidy to make sure that all that has to be quoted is, then apply XSL transformation using xsltproc.  Once .fo is generated I use FOP to produce a .pdf out of it.