Having a good discussion on the forum regarding fixed row enumeration. Maybe you have a fixed height for a table on some pre-printed stationary. I have documented a way to fix the number of rows on a page a few years back. the twist to the requirement is that if I have 'line' data that will not fit on a single row and needs to wrap then where I might have had room for 10 rows on the paper output, because of the string wrapping I only now have the physical room, on the paper for 6 rows. But my original logic did not allow for this.
I don't have the answer to that piece yet, looking into it. Development, well template meister Hok Min has a doozy of an enhancement for the 11g release. True fixed table height support, you need a 5inch high table filled with as many rows as will or will not fit? Hok Min has the command. But you'll have to wait for 11g. When is that coming? Sometime within the next calendar year is the official line, unofficially, sooner rather than later - see you are still in the dark, gotta cover my a$$.
Back on the fixed row, I got a requirement this week to fill out empty rows in a table if the amount of data was not enough. Its its still fixed rows, you just want to show them. Rather than the solution I showed a few years back I found a new and groovy way to do it. The good ol for...next loop. Where's that documented then? Its in there, just tucked a away with the shape support.
It showed itself recently in my 'date' post and I have used it again this week.
Normal table to render the 'line' data, the next two fields. The variable field, numRows Variable:
<?variable:numRows;number(12)?>
just stores a value for the number of rows you want to show. You can hard code this value too, if you would like. The next field:
<?for-each:xdoxslt:foreach_number($_XDOCTX, 1,numRows-count(.//G_TEC_ID1),1)?>
All this is doing is using a command to effectively give me a for...next loop, starting at 1 up to 12(variable value) - the number of rows in the G_TEC_ID1 group with a step of 1
Then I have an empty nested table with zero cell borders to get it to butt up to the edges of the parent table and some selective borders showing.
The next field closes out the filler - <?end for-each?>
Much faster to develop than the original, neater too. Will be looking into the wrapping rows issue over the next few daze as time permits.
Comments (5)
Tim,
I had come across this fixed line requirement for invoice print. I had also handled the text wrapping while printing fixed line.
After seeing this post I had tried explained how I had handled text wrapping and fixed lines in my blog.
This logic is implement for 2 of my clients and its working good without any issues for last 2 years now :)
Let me know if my logic is good and Is there any way to optimize the logic.
Lakshmanan
Posted by Lakshmanan | October 6, 2009 11:27 AM
Posted on October 6, 2009 11:27
Tim,
I had faced same problem around a year ago. At that time i used sub-templates for the header and footer to display detail other than the invoice data(Data in table format) with the help of display-condition e.g. first, last, exceptfirst, exceptlast, everytime etc..
Details of same is as follows:
<?template:footerDetails?>
<xdofo:inline-total display-condition="exceptfirst"
name="showCondition">
Detail to be shown after the dynamic table on the pages other than first page.
</xdofo:inline-total>
<xdofo:inline-total display-condition="first"
name="showCondition">
Detail to be shown after the dynamic table on the first page only.
</xdofo:inline-total>
<?end template?>
<?template:headerDetails?>
Detail to be shown before the dynamic table
<?end template?>
<!-- To be used in the footerDetails and headerDetails for display conditions -->
<?init-page-total: showCondition?> <?add-page-total:showCondition;1?>
<!-- use --><?call-template: headerDetails?><!-- in Header-->
Data to be display in dynamic table as a main section.
<!-- use --><?call-template: footerDetails?><!-- in Footer -->
Let me know if any improvement or suggestions for this logic.
Kandarp
Posted by Kandarp Doshi | October 25, 2009 9:58 PM
Posted on October 25, 2009 21:58
Could you please provide me the RTF file and Sample XML available with you for this example...
Thanks in advance...
Posted by meib | October 26, 2009 4:30 AM
Posted on October 26, 2009 04:30
I had uploaded the rtf template and xml file in my personal blog here
Let me know if you find any tuning in the template.
Posted by Lakshmanan | November 7, 2009 9:08 PM
Posted on November 7, 2009 21:08
Tim,
This is a much cleaner solution than the anatomy of a template/fixed row enumeration i've tried.
Problem still exists with a single element found in the repeating section vs multiple (I'm working on the AP Check so it's invoices in my case). The overall height is still larger with the multiple invoices than with single. When there are multiple invoices paid per check it pushes the end of the table down lower than if there was only one invoice. Have you gotten around this? I'm also printing on pre-printed stationary and I haven't found a solution.
Thanks,
Cliff
Posted by Cliff Witherspoon | November 11, 2009 4:17 PM
Posted on November 11, 2009 16:17