[prev in list] [next in list] [prev in thread] [next in thread] 

List:       fop-user
Subject:    RE: How to dynamically add columns to fo:table in xsl fo
From:       "Amick, Eric" <Eric.Amick () mail ! house ! gov>
Date:       2013-04-15 11:55:21
Message-ID: 0AB460B0692CD24E8D1E3172983977C1019B26 () HEOC-HRM03 ! US ! House ! gov
[Download RAW message or body]

Since you're using XSLT, why not do something like this?

<fo:table-column number-columns-repeated="{some-expression-or-other}" />

I would think xsl:if and/or xsl:choose would be useful as well.


Eric Amick   Systems Engineer II
Legislative Computer Systems

From: sree1109 [mailto:sree.1109@gmail.com]
Sent: Saturday, April 13, 2013 5:49 AM
To: fop-users@xmlgraphics.apache.org
Subject: How to dynamically add columns to fo:table in xsl fo

Hi,

I m trying to convert a set of db results into PDF using XSL FO. Depending on the \
query, the number of columns returned might differ.Also, based on the value of a \
column(in my case, Offer type), I have to choose/ignore only certain columns which I \
can specify in my XSLT header/value templates.

My problem is with fo:table-column. I cannot give a static number here for \
number-columns-repeated. Is there a way to dynamically add table-columns and handle \
different result set using a single XSLT?


[Attachment #3 (text/html)]

<html xmlns:v="urn:schemas-microsoft-com:vml" \
xmlns:o="urn:schemas-microsoft-com:office:office" \
xmlns:w="urn:schemas-microsoft-com:office:word" \
xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" \
xmlns="http://www.w3.org/TR/REC-html40"> <head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 12 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
	{font-family:Tahoma;
	panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:purple;
	text-decoration:underline;}
p
	{mso-style-priority:99;
	mso-margin-top-alt:auto;
	margin-right:0in;
	mso-margin-bottom-alt:auto;
	margin-left:0in;
	font-size:12.0pt;
	font-family:"Times New Roman","serif";}
span.EmailStyle18
	{mso-style-type:personal-reply;
	font-family:"Calibri","sans-serif";
	color:#1F497D;}
.MsoChpDefault
	{mso-style-type:export-only;}
@page WordSection1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
	{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Since \
you&#8217;re using XSLT, why not do something like this?<o:p></o:p></span></p> <p \
class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
 <p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">&lt;fo:table-column \
number-columns-repeated=&#8221;{some-expression-or-other}&#8221; \
/&gt;<o:p></o:p></span></p> <p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
 <p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">I \
would think xsl:if and/or xsl:choose would be useful as well.<o:p></o:p></span></p> \
<p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
 <p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
 <p class="MsoNormal"><span \
style="font-size:7.5pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:black">Eric \
Amick&nbsp;&nbsp; Systems Engineer II<o:p></o:p></span></p> <p \
class="MsoNormal"><span \
style="font-size:7.5pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:black">Legislative \
Computer Systems</span><span style="color:#1F497D"><o:p></o:p></span></p> <p \
class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
 <div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span \
style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">From:</span></b><span \
style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"> \
sree1109 [mailto:sree.1109@gmail.com] <br>
<b>Sent:</b> Saturday, April 13, 2013 5:49 AM<br>
<b>To:</b> fop-users@xmlgraphics.apache.org<br>
<b>Subject:</b> How to dynamically add columns to fo:table in xsl \
fo<o:p></o:p></span></p> </div>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">Hi, <o:p></o:p></p>
<p>I m trying to convert a set of db results into PDF using XSL FO. Depending on the \
query, the number of columns returned might differ.Also, based on the value of a \
column(in my case, Offer type), I have to choose/ignore only certain columns which I \
can specify  in my XSLT header/value templates.<o:p></o:p></p>
<p>My problem is with <b>fo:table-column</b>. I cannot give a static number here for \
number-columns-repeated. Is there a way to dynamically add table-columns and handle \
different result set using a single XSLT?<span \
style="color:#1F497D"><o:p></o:p></span></p> </div>
</div>
</body>
</html>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic