BIRT Report Designer - Table to Produce Rows in Multi Columns

Viewed 27

I have a table, which is listing the name of benefits and it is only 1 column (just name of the benefit).

I'm wondering if there is any native function of BIRT Report Designer to produce rows not only vertically but also populate horizontally to 3-4 columns.

Something like below:

Benefits List

Benefit-1 Benefit-3 Benefit-5

Benefit-2 Benefit-4 Benefit-6

Thanks in advance for any advice.

2 Answers

Ok, I found a solution!

Under the following link there is a Eclipse Community Page Link recommendation about an additional computed column. Even though I don't have any computed column, the recommendation gave me an inspiration. Instead of creating an additional column, I used the rownum that is used generally to bind dataset parameter. For the table row, I created "visibility" condition that checks if the rownum + 1 is divided by 3. Depending on what is the result, it will be hidden or viewed:

Main Grid

It includes a grid with 2 rows and 3 columns. 1 row is merged to view the header. In each column of second row, the same table is placed with the same dataset.

Image Showing Main Structure

Select Table Row

Image Indicating Row Selection

Set the Visibility

Image Showing Details of Visibility Condition

The syntax basically means: "Do not show the row if the division result is not 1".

For the second column, you will need to compare with 2: (row.__rownum + 1) % 3 != 2 and the third column with 0: (row.__rownum + 1) % 3 != 0

Hope it'll be helpful for someone.

An more straightforward approach ist to use a List item instead of a Table item.

In the detail area of the List, create a Grid item of fixed width and height. Put the content (e.g.) text into the grid's cells.

Important: Set the "display" property of the grid to "inline" instead of the default "block".

This way BIRT will put the grids from left to right until the line is full. Then it will fill the next line (think of "display: inline" like adding words to a paragraph).

Related