eclipse-birt / birt

Eclipse BIRT™ The open source reporting and data visualization project.
http://www.eclipse.org/birt
Eclipse Public License 2.0
450 stars 389 forks source link

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

Closed Markus-Elfring closed 1 year ago

Markus-Elfring commented 2 years ago

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.

SteveSchafer-Innovent commented 2 years ago

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.

Markus-Elfring commented 2 years ago

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

Examples:

hvbtup commented 2 years ago

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.

Markus-Elfring commented 2 years ago

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

hvbtup commented 2 years ago

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.

speckyspooky commented 1 year ago

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