|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Need exactly 23 rows of output before next page
On Aug 12, 2004, at 12:55 PM, J.Pietschmann wrote:
Clay Leeds wrote:I am re-creating a medical form which outputs exactly 23 rows per page (i.e., if there are 3 rows of data, 23 nodes are output; if there are 24 rows of data, 46 nodes are output, w page one having 23 rows of data, and page 2 having one row of data filled/22 rows empty, etc.). Ahh the joys of medical billing! I've got another form to do too! Can you say "nudge"!? I've got table-row heights & table-column-widths out the yin yang! You can compute the number of rows necessary to make the total number a multiple of 26 using the mod operator, and fill the missing rows using the wendell-piez-method or a recursive template: There's one error in there... I think '<' should be '<': <xsl:for-each select="//node()[position() < (24 - ($detail-count mod 23))]"> Unfortunately, with 4 DETAILLINEs, it outputs 49 pages. With 3 it outputs 48 pages, With 2 it outputs 46 pages. With 1 it outputs 45 pages. It looks like the 'baseline' number of pages seems to be related to 46... a multiple of 23... hmmm... BTW, one other problem I've got is how to maintain the alternating row background-color... I'm using the following to specify bgcolor: <xsl:attribute name="background-color"><xsl:choose><xsl:when test="(position() mod 2) = 0"><xsl:value-of select="$varAccentBGColor"/></xsl:when><xsl:otherwise><xsl:value-of select="$varNormalBGColor"/></xsl:otherwise></xsl:choose></xsl: attribute> It works if I have an even number of DETAILLINEs w data. Of course, in this case position() is being used... If I use $detail-count instead bgcolor for empty rows stays the same... I need to come up with a solution which sets up the starting empty row bgcolor based on whether the number of DETAILLINEs is odd or even. There should be multiple alternative, possibly more elegant and/or correct formulations of the solution. If performance is bad, switch to a recursive template (the XSLT FAQ has it all). I looked in the XSLT FAQ, and couldn't come up with an intelligent enough wording for searching. Any ideas on a good query? Web Maestro Clay
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








