Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. The Band gets added: As there are no column breaks yet, A column break will be added for X1=0 and X2=500. A rowbreak is added at Y1=0 and Y2=200.
    The first break always marks the start of the table, and the last break marks the end (and total-width) of the table. The table now consists of a single cell, that has a width of 500 points and a height of 200 points. | (empty)
    |
  2. The Label gets added: As there is no column break for X1=100, a new column break is inserted. The table's only cell splits into two columns. | (empty)
    | Label |

    A column break for X2 gets inserted at position 300. The table now contains 3 columns. | (empty)
    | Label
    | (empty) |
    The Label's Y1 does not cause a row-break, as the band already caused one at this position. A row break for Y2 gets inserted at position 100. The table now consists of two rows. | (empty) | Label | (empty) |

     

     

      (empty)

    (empty)

    (empty)


  3. The text field is added to the table. X1 does not cause a column break, as there is already one at this position. X2 causes a new column break at position 250. Note that the label already occupies the cell from X=100 to X=300. This cell will now span two columns. There is already a column break for the text-field's Y1 position (at Y=100, caused by the labels bottom edge) and for the Y2 position (at Y=200, caused by the band's bottom edge). | (empty) | Label | (empty)
    |

      (empty)

    Text Field

     

      (empty)

    (empty)

If the table-generator uses the simple algorithm, the resulting table gets simplified in a second step. The column breaks at position 250 and 300 have been caused by a right edge of an report element. These breaks now get removed, so that the resulting table looks like this: | (empty) | Label |

  (empty)

Text Field

Now it should be clear, that the table-generator works best, if all elements are properly aligned. All elements that should go into one row or column have to start at the same X and y positions. If the strict layouting mode is used, they also must end at the same position. Elements that should go into neighbouring cells must share a common edge. And finally: Elements that do not start at position Zero will cause an empty column or row.

In the next post, I'll cover how Pentaho Reporting Classic computes cell backgrounds and borders.