FOP : errors with nested tables that have <tr><td>/<td></tr>

81 views
Skip to first unread message

Slim7699

unread,
Jan 30, 2012, 10:00:32 AM1/30/12
to InterSystems: Zen Community
Good morning,

I have a problem when I transform my xml,xsl file to pdf. I'm using
FOP 1.0. I have nested tables in a Zen Report that have cell formating
<tr><td>/<td></tr>. When I delele the <tr><td>/<td></tr> fop can
transform but the look is not good, the cells are one over the other.
Why FOP is not taking my <tr><td>/<td></tr> definitions?

Christian Wessel

unread,
Jan 30, 2012, 10:04:27 AM1/30/12
to InterSystems: Zen Community
Hello Slim,
 
first the tag should call </td>.
Then enter just an unvisible character between <td> and </td>. I guess that should help you.
 
christian

>>> Slim7699 <salim...@gmail.com> 30.01.2012 16:00 >>>
--
You received this message because you are subscribed to the Google Groups "InterSystems: Zen Community" group.
To post to this group, send email to InterSys...@googlegroups.com
To unsubscribe from this group, send email to InterSystems-Z...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/InterSystems-ZEN?hl=en
Zen Community Terms and Conditions: http://groups.google.com/group/InterSystems-ZEN/web/community-terms-and-conditions

Slim7699

unread,
Jan 31, 2012, 4:47:04 PM1/31/12
to InterSystems: Zen Community
Hi Christian,

The class %ZEN.Report,Display,TableOutput have methods that write
automatically the tags as follow:

<fo:table-body>
<fo:table-row>
<fo:table-cell>
<fo:block>
<fo:inline>
<xsl:value-of-select="the data field name"/>
</fo:inline>
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>

So I can't put extra <tr> <td> </td> </tr> in the tbody of the table
because FOP will through errors of validation. How can I change the
properties of the <fo:table-row> and <fo:table-cell> in the <fo:table-
body> ?

The only example that I found in this forum is with THEAD tag... but
when I want to have nested tables in the tbody of a table, I dont
known how to do rowspan or colspan.

Thanks,

Salim



On 30 jan, 10:04, "Christian Wessel" <wes...@hhla.de> wrote:
> Hello Slim,
>
> first the tag should call </td>.
> Then enter just an unvisible character between <td> and </td>. I guess that should help you.
>
> christian
>
> >>> Slim7699 <salimm7...@gmail.com> 30.01.2012 16:00 >>>
>
> Good morning,
>
> I have a problem when I transform my xml,xsl file to pdf. I'm using
> FOP 1.0. I have nested tables in a Zen Report that have cell formating
> <tr><td>/<td></tr>. When I delele the <tr><td>/<td></tr> fop can
> transform but the look is not good, the cells are one over the other.
> Why FOP is not taking my <tr><td>/<td></tr> definitions?
>
> --
> You received this message because you are subscribed to the Google Groups "InterSystems: Zen Community" group.
> To post to this group, send email to InterSys...@googlegroups.com
> To unsubscribe from this group, send email to InterSystems-Z...@googlegroups.com
> For more options, visit this group athttp://groups.google.com/group/InterSystems-ZEN?hl=en
> Zen Community Terms and Conditions:http://groups.google.com/group/InterSystems-ZEN/web/community-terms-a...

APZ

unread,
Feb 10, 2012, 4:52:59 PM2/10/12
to InterSystems: Zen Community
Hello Salim,

Depending on what properties you want to change, you might try using a
style-class.

In the ReportDisplay <document>, add two entries like this:
<class name="th.mynewstyle"><att name="..." value="..."/></class>
<class name="td.mynewstyle"><att name="..." value="..."/></class>

Then, in the <table> (or on the <item> etc within the table), set the
class attribute to the above-defined style-class's name. Only use the
part after the period: <table class="mynewstyle" ... />

The att-value(s) defined in the style-class that has "th" as the first
part of its name will be applied to the header cell and the one that
has "td" to the non-header cells (even though FOP uses <fo:table-cell>
internally).


If the only thing you are trying to set is colspan and rowspan, please
be aware that <item> has "colspan" and "rowspan" attributes, too. In
fact, most/all elements that can be used inside a <table> have these;
not just <th> and <td>.

Ariela

Slim7699

unread,
Feb 17, 2012, 1:55:59 PM2/17/12
to InterSystems: Zen Community
Hello Ariela,

Thank you very much,

But my problem is when the xsl file is generated. I have a <fo:block>
as the parent of a <fo:table-row> and FOP is saying that is not
correct. How can I get rid of the <fo:block> infront of <fo:table-
row>?

here is a part of the xsl file :

- <xsl:template match="SalesRep" mode="group1">
- <fo:block>
<xsl:attribute name="text-align">center</xsl:attribute>
- <fo:table table-layout="fixed" xsl:use-attribute-
sets="table.myTable">
<xsl:attribute name="width">50%</xsl:attribute>
<fo:table-column column-width="proportional-column-width(1)" />
- <fo:table-body>
- <fo:table-row>
- <fo:table-cell xsl:use-attribute-sets="td.myTable">
- <fo:block>
- <fo:table-row>
- <fo:table-cell>
- <fo:block>
<xsl:attribute name="text-align">center</xsl:attribute>
- <fo:block>
- <![CDATA[ Name
]]>
</fo:block>
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
- <fo:table-body>
- <fo:table-row>
- <fo:table-cell xsl:use-attribute-sets="td.myTable">
- <fo:block>
- <fo:table-row>
- <fo:table-cell>
- <fo:block>
<xsl:attribute name="text-align">center</xsl:attribute>
- <fo:inline xsl:use-attribute-sets="td.Cell1">
<xsl:attribute name="width">40%</xsl:attribute>
<xsl:value-of select="@Name" />
</fo:inline>
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
- <fo:table-body>
- <fo:table-row>
- <fo:table-cell xsl:use-attribute-sets="td.myTable">
- <fo:block>
- <fo:table-row>
- <fo:table-cell>
- <fo:block>
- <fo:block>
<xsl:attribute name="text-align">left</xsl:attribute>
- <xsl:if test="Customer">
- <fo:table table-layout="fixed" xsl:use-attribute-
sets="table.myborder">
<xsl:attribute name="width">100%</xsl:attribute>
<fo:table-column column-width="1in" />
<fo:table-column column-width="proportional-column-width(1)" />
<fo:table-column column-width="proportional-column-width(1)" />
- <fo:table-header>
- <fo:table-row>
- <fo:table-cell>
- <fo:block>
- <fo:inline>
- <![CDATA[ #
]]>
</fo:inline>
</fo:block>
</fo:table-cell>
- <fo:table-cell>
<fo:block />
</fo:table-cell>
- <fo:table-cell>
<fo:block />
</fo:table-cell>
</fo:table-row>
</fo:table-header>
- <fo:table-body>
<xsl:apply-templates select="Customer" mode="table2" />
</fo:table-body>
</fo:table>
</xsl:if>
</fo:block>
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:block>
</xsl:template>
> > Salim- Masquer le texte des messages précédents -
>
> - Afficher le texte des messages précédents -

Jonathan Levinson

unread,
Feb 29, 2012, 3:40:51 PM2/29/12
to intersys...@googlegroups.com
Hi Salim,

You said you looked at thead as a possible solution. You said it would work but was in the header position. (???) Could you use tbody, instead?

What version of Cache' or Ensemble is running the ZEN Reports? It would help to know the version number.

The XSL file you sent is helpful, but it is difficult to figure out from reading the XSL what ZEN Report produced the XSL ( the XSL that FOP can't use because of a misplaced fo:block).

Can you attach your ZEN Report that has this problem to a reply to this e-mail?

Thanks,
Jonathan Levinson
Senior Software Developer
Object Group
InterSystems
+1 617-621-0600
jonathan...@intersystems.com

> -----Original Message-----
> From: intersys...@googlegroups.com [mailto:intersystems-
> z...@googlegroups.com] On Behalf Of Slim7699
> Sent: Friday, February 17, 2012 1:56 PM
> To: InterSystems: Zen Community
> Subject: Re: Antw: [InterSystems-Zen] FOP : errors with nested tables that have
> <tr><td>/<td></tr>
>

> --
> You received this message because you are subscribed to the Google Groups
> "InterSystems: Zen Community" group.
> To post to this group, send email to InterSys...@googlegroups.com To

> unsubscribe from this group, send email to InterSystems-ZEN-
> unsub...@googlegroups.com

> and-conditions

Reply all
Reply to author
Forward
0 new messages