Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Horizontal page breaks and consistent row height
Horizontal page breaks and consistent row height [message #1008178] Mon, 11 February 2013 09:43 Go to next message
Tor-Einar Jarnbjo is currently offline Tor-Einar JarnbjoFriend
Messages: 7
Registered: February 2013
Junior Member
I've been trying to use the horizontal page-break feature, so that wide tables are split between columns across multiple pages.

It sort of works, but not exactly as I expected. Just as column widths are kept consistent across multiple pages when using vertical page breaks, I would expect that the row heights are kept consistent across all pages when using horizontal page breaks. I am not sure if I simply have to adjust a table property somewhere, but with the default values, BIRT 4.2.1 recalculates the required row height for each page separately, so that table rows are likely to be misaligned, when the pages are placed next to each other.

Anybody with an idea how to get horizontal page breaks and keep the row height across all pages? Using a fixed row height is not an option.
Re: Horizontal page breaks and consistent row height [message #1008336 is a reply to message #1008178] Mon, 11 February 2013 23:18 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

I know you said using fixed row heights are not an option, but if you use them does it work? Do you have a sample we can run?


Jason
BIRT-Exchange
Re: Horizontal page breaks and consistent row height [message #1008439 is a reply to message #1008336] Tue, 12 February 2013 13:50 Go to previous messageGo to next message
Tor-Einar Jarnbjo is currently offline Tor-Einar JarnbjoFriend
Messages: 7
Registered: February 2013
Junior Member
Yes, using a fixed row height works, but since the amount of content in each cell is rather unpredictable, it is not really an option for me to calculate the row height manually.

I've added a minimal example showing the behaviour with the designer project, XML data source, designer preview (.png) and PDF output.

Except that the page breaks are ignored in the designer preview, the output there is as expected. The example is just a simple table with two columns and two rows. The cells R1/C1 and R2/C2 contain two lines of text, the cells R1/C2 and R2/C1 contain only one line of text.

In C1, I have the property "Page break, after" set to "always", so that C2 is forced onto the next page. In the PDF output, the height of the cells R1/C1 and R1/C2 should IMHO be the same and provide for the two lines of text in R1/C1. The cell height of R1/C2 does however only provide for one line of text, causing the rows R1 and R2 to be misaligned, if the pages are placed next to each other.
Re: Horizontal page breaks and consistent row height [message #1008503 is a reply to message #1008439] Tue, 12 February 2013 18:24 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Set you paddings to 0 on the data items and cell. See attached modified example.

Jason
Re: Horizontal page breaks and consistent row height [message #1008511 is a reply to message #1008503] Tue, 12 February 2013 19:16 Go to previous messageGo to next message
Tor-Einar Jarnbjo is currently offline Tor-Einar JarnbjoFriend
Messages: 7
Registered: February 2013
Junior Member
Using your attached design template, the cells have no padding, but the row heights are still wrong. The text "Row 2, C1 / Text-Line 1" should be aligned with "Row 2, C2 / Text-Line 1", when the pages are placed next to each other.

For clarification, here the expected (line height consistent across all pages) and actual layout (line height calculated for each page separately):

index.php/fa/13397/0/

[Updated on: Tue, 12 February 2013 20:03]

Report message to a moderator

Re: Horizontal page breaks and consistent row height [message #1008541 is a reply to message #1008511] Tue, 12 February 2013 22:15 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

What you are wanting is essentially for the engine to calculate the maximum cell height and then fix it for all data, and currently BIRT does not do this unless you manually set the height. This sounds like a great enhancement request. Can you open a bugzilla entry for it and attach that scan.

Jason
BIRT-Exchange

[Updated on: Tue, 12 February 2013 22:16]

Report message to a moderator

Re: Horizontal page breaks and consistent row height [message #1008556 is a reply to message #1008541] Wed, 13 February 2013 00:42 Go to previous messageGo to next message
Tor-Einar Jarnbjo is currently offline Tor-Einar JarnbjoFriend
Messages: 7
Registered: February 2013
Junior Member
I am still not sure if my problem is clear. I do not want to use the maximum cell height for all data, but for all cells in the same row, just as it is actually done if no horizontal page break is used within the table.

If I use Excel-naming for the cells in my drawing (columns A-D and rows 1-2), the cell A1 contains three lines of text, B1 has two lines of text and C1/D1 both have one line of text. In the first row, the cell with the maximum height is A1 (three text lines). If all columns are output on the same page, the height of A1 is also used for the cells B1, C1 and D1 (all cells in the first row). If I have a page break between the columns B and C, the height of A1 and B1 is obviously calculated as max(height(A1), height(B1)), while the height of the cells C1 and D1 is calculated as max(height(C1), height(D1)).

Is the layout engine really working as expected here, when it recalculates the row height separately for each page? If the layout engine is consequent, turning the issue 90° would mean that column widths should be recalculated after a vertical page break as well, but they are not. If one table spans multiple pages vertically, the column widths are kept the same on each page.
Re: Horizontal page breaks and consistent row height [message #1008773 is a reply to message #1008556] Wed, 13 February 2013 20:35 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

I understand what you are saying. I do not think the logic is in the code to handle rows like columns though. The main reason for this may be to conserve on the amount of white space. This about a table that has 10 rows. 9 of the rows are one line. The 6 row contains 8 lines of text. If each row was sized based on the 8 lines of text that would be a lot of white space. I still think this would make a great option for horizontal page breaks. From a stand point of overcoming the issue now, you could possibly script the height. For example, add a computed column to the data set that calculates the number of line feeds for a data item. Then add a max aggregation computed column to the data set to get the maximum for a row and then in the onCreate script set the row height based on the maximum value. See attached modified example.


Jason
BIRT-Exchange
Re: Horizontal page breaks and consistent row height [message #1009077 is a reply to message #1008773] Thu, 14 February 2013 11:41 Go to previous messageGo to next message
Tor-Einar Jarnbjo is currently offline Tor-Einar JarnbjoFriend
Messages: 7
Registered: February 2013
Junior Member
Both your responses and also the scriptheight.rptdesign example are not solutions to my problem, so I am actually pretty sure that we don't understand each other Confused

You seem to believe that I am looking for a way to get all table rows to be set to the same height, and you are probably right that I in that case would waste a lot of whitespace. That is not what I want and as you can see in my drawing, even in my expected layout, the rows are of different height. The first row has a height to provide for three lines of text, while the second row has a height to provide for four lines of text.

If we look at my example again (this time with named cells):

index.php/fa/13417/0/

Each cell has the following number of text lines:

A1: 3
B1: 2
C1: 1
D1: 1

A2: 1
B2: 4
C2: 1
D2: 2

Now, to keep the rows aligned across all pages, the row heights must be calculated as follows:

Row1.height = max(A1.height, B1.height, C1.height, D1.height)
Row2.height = max(A2.height, B2.height, C2.height, D2.height)

While BIRT currently seem to do something like:

Page1.Row1.height = max(A1.height, B1.height)
Page2.Row1.height = max(C1.height, D1.height)
Page1.Row2.height = max(A2.height, B2.height)
Page2.Row2.height = max(C2.height, D2.height)

Note again: The problem exists only if a table is split horizontally across several pages. As long as all columns are on one page, everything works as expected.


Now, even if your scriptheight.rptdesign is a step in the right direction, it does not solve my problem and I don't find any obvious way using the scripting API to do so. One major problem is that you are simply counting the line feeds directly in the text from the data source. This will not work for longer lines, where BIRT automatically uses word wrapping to split the longer "physical" text line over multiple "layout" lines.

If there was a method in the scripting API to access the calculated height of each cell within a row, I could always work with that, but if I understand it correctly, the "this" reference in the DetailRow.onCreate handler is of type IRowInstance and from there, I only have access to the cell content and not the actual Cell instances, on which I could query the height?

  • Attachment: Scan002.png
    (Size: 23.58KB, Downloaded 2694 times)
Re: Horizontal page breaks and consistent row height [message #1009213 is a reply to message #1009077] Thu, 14 February 2013 17:17 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Other than doing something similar to what I posted before I do not have a work around. The previous example could be modified to calculate maximum line feeds for a given row instead of the table. You may also be able to just count the characters, although this may suffer from the same issue.

Jason
BIRT-Exchange
Re: Horizontal page breaks and consistent row height [message #1009566 is a reply to message #1009213] Fri, 15 February 2013 10:24 Go to previous message
Tor-Einar Jarnbjo is currently offline Tor-Einar JarnbjoFriend
Messages: 7
Registered: February 2013
Junior Member
That's a pity, but thank you very much for your efforts.

I assume we will have to look for a completely different solution.
Previous Topic:Tribix PPT emitter for BIRT WebViewer v4.2.1
Next Topic:chart Zooming
Goto Forum:
  


Current Time: Thu Apr 18 16:42:24 GMT 2024

Powered by FUDForum. Page generated in 0.07019 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top