Across not Down!

As an extension to the article I wrote earlier on getting grouping to work across the page rather than down the page. I received a question from Vidhya at Smart Dog Services - an Oracle partner. Here goes:


Can you please give me the syntax for doing the following

 

My XML file looks something like this:

<G_DESCRIPTION>
<DESCRIPTION>Load</DESCRIPTION>
<G_COMMISSION>
<COMMISSION>.4</COMMISSION>
</G_COMMISSION>
</G_DESCRIPTION>
<G_DESCRIPTION>
<DESCRIPTION>Transactions</DESCRIPTION>
<G_COMMISSION>
<COMMISSION>.3</COMMISSION>
</G_COMMISSION>
</G_DESCRIPTION>


In my template I have a table which will have columns like :
Loads        Transactions


When the column is Loads , it has to pouplate the value of commission for Loads (ie 0.4 ), similarly when the column in Transactions, it needs to populate the value of commission for transactions (ie 0.3)

So the data would look something like

 

Loads        Transactions

0.4              0.3

How can I specify this condition in my template

Its another get the grouping across the page not down it. But there is a little wrinkle in here I think. Vidhya sent only a couple of columns of data, I assume that can be dynamic. So we need to handle the possibility of more columns coming in at runtime. We can use the @column and @cell functions to do this - its pretty well documented but you need to play around with it to understand what's going on.


We need a two celled table that looks like this:


DynCols:


The column is going to get repeated for each dynamic column coming into from the data, so set the width as needed. To explain the contents of the fields:


FE Col Desc - <?for-each@column:G_DESCRIPTION?> - this is going to create a new column in the table for every member of the G_DESCRIPTION group that there is
Description - you should be able to work that one out
EFE - closing out the G_DESCRIPTION group


FE Cell Comm - <?for-each@cell:G_COMMISSION?> - creates a cell for every member of the G_COMMISSION group present
Commission - <?COMMISSION?>
EFE - closing the G_COMMISSION group


This gets us the output Vidhya is looking for with the column titles coming from the DESCRIPTION and the values from the COMMISSION element. As more columns come in, the table will fill across the page, once it reaches the edge it will break to a new page. If you have a similar requirement but want to repeat a fixed set of row headers you can use the horizontal-break-table: command.


If you want the columns widths to adjust as columns come into the document then the dynamic columns section in the user guide is going to help you out there.

Comments:

Hi Tim, The horizontal-break-table: command breaks the table to the next page. Is there a way to break a big table to the next line, so that both the tables come together in the same page?

Posted by Anupam on May 17, 2009 at 04:57 PM MDT #

It is extremely interesting for me to read the article. Thank you for it. I like such topics and anything that is connected to this matter. I definitely want to read a bit more soon.

Posted by Cyprus escort service on December 21, 2009 at 04:30 AM MST #

Hi: I am experiencing an issue with such scenario. I have one set of records that print fine. (Example: 5 columns) I have a second set of records that should start as new but the table starts from 6th column leaving first 5 columns. Note: I made the second set of records to start as new table but even when it starts a new table, first 5 columns are left bank and starts new from 6th column. Could you pl. suggest. Thanks, Vamsi.

Posted by Vamsi on February 01, 2010 at 12:42 AM MST #

I take joy in your time and effort which you have given to this thread. I'm excited for your next blog post.Please that I recently came across this an informative and interesting blog. I just now hope you could create another post pertaining to this. It is worthwhile reading.

Posted by Curt Pfieffer on July 30, 2010 at 05:32 AM MDT #

This has definitely sparked up an concept in my thoughts. This can be a wonderful weblog publish.

Posted by never fail list building bonus on August 22, 2010 at 04:31 AM MDT #

Hi

I am working on a bi publisher report using a nested loop and a single cell.
inner loop is prnting the data vertically whereas the outer loop printing the whole data vertically.
working fine , but not getting the lines between rows.
Please suggest

Posted by guest on November 17, 2011 at 08:44 PM MST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Follow bipublisher on Twitter Find Us on Facebook BI Publisher Youtube ChannelDiscussion Forum

Join our BI Publisher community to get the most and keep updated with the latest news, How-to, Solutions! Share your feedback and let us hear your voice @bipublisher on Twitter, on our official Facebook page, and Youtube!

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today