birt icon indicating copy to clipboard operation
birt copied to clipboard

Using combined multiple columns for headers and footers in grouped listing reports

Open Markus-Elfring opened this issue 3 years ago • 5 comments

A table widget is provided by the tool “Eclipse BIRT Designer Version 4.9.0.v202203150031” for the construction of grouped listing reports. I came along advanced usage requirements which matter more for layout of information according to headers and footers.

  • Each cell provides display space for a simple grid layout.
  • Items can be concatenated for the functionality “dynamic text” by the means of the expression builder. Thus long text strings can be constructed on demand which might occasionally not fit into the selected cell width. :crystal_ball: How are the chances to extend this widget in the way so that a cell can use the space according to multiple columns?

Markus-Elfring avatar May 23 '22 15:05 Markus-Elfring

This sounds like something you could do with javascript for a one-off or create a custom plugin. See https://github.com/innoventsolutions/innoventsolutions.github.io/wiki for an example.

SteveSchafer-Innovent avatar May 23 '22 18:05 SteveSchafer-Innovent

The mentioned adjustment desire is well-known from other application domains.

Examples:

Markus-Elfring avatar May 24 '22 08:05 Markus-Elfring

BIRT supports merging cells.

You can do this by selecting adjacent in the cells and choose "merge cells" from the context menu. This works in header and footer rows as well.

However, you can not set the colspan or rowspan attributes dynamically.

[This is not quite true, it is possible with the DE API (Design Engine API), but only at a very early time in the excecution of the report when you don't have access to the data yet] The reason is that this would have to change the layout structure.

Anyway, there is an easy way to achieve the same effect in many cases.

Say, for example, that your table can show textual results and numerical results with a unit, each result in its own row. So you have (among others) two columns, one for the numerical value and one for the unit. The textual result can be longer, so you want to merge these two columns to show the textual result for those rows.

The solution here is to create a second detail row. The first detail row is for a numerical result. The second detail row is for a textual result. You can merge the two cells in the second row and show the text result there. The two cells in the first row show the numerical result and the unit.

Add a visibility expression to the two rows in such a way that the conditions are exactly the opposite. The first row should be hidden if there is a text result (this might look like !!row["TEXT"]) (the two exclamation marks mean: convert this to a boolean, e.g. true if the text is not empty and false if the text is undefined, null or empty. For the second row, the visibility expression is !row["TEXT"] with only one explamation mark: hide the row if there is no text.

hvbtup avatar May 24 '22 12:05 hvbtup

You can do this by selecting adjacent in the cells and choose "merge cells" from the context menu.

  • I guess that this functionality depends on the safe selection of adjacent cells. A temporary selection status might give other indications.
  • Would another context menu entry become helpful for the extension of the cell space into a desirable direction?

Markus-Elfring avatar May 24 '22 12:05 Markus-Elfring

I don't understand what you mean with "safe selection". A tip to select a cell (and not its content!) in the layout is to use the breadcrumb bar. And you can use shift cursor-key to extend the selection to the next cell. It's always easiest to start with an empty cell if you want to select several adjacent cells.

hvbtup avatar May 24 '22 12:05 hvbtup

According of the explanations of hvbtup it seems that the specifc/advanced requirements can be done with the current BIRT-feature-set.

speckyspooky avatar Oct 01 '23 12:10 speckyspooky