Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stretch a row with data overflow while having multiple rows in a single band

Tags:

My requirements bind me to have multiple rows in a single "Details" band.

Right now I am having a static text field (which is highlighted in color) in the leftmost column and three text data fields next to it.

What I want in my report is, the static text band along with the three bands should stretch in height when data in either of the three bands overflows, with the next row "properly" displayed below the stretched row. By "properly" I mean the next row elements should have their "top" values the same and be displayed in the same "row".

I tried setting "Stretch with overflow" flag to "true" and "Position" to "float" but the problem is that the next row data is not properly positioned.

like image 613
Rachcha Avatar asked May 02 '12 11:05

Rachcha


2 Answers

In case someone comes up to this problem and above answers don't work. I suggest checking your xml's root element. If it has the following attribute then remove it:

printOrder="Horizontal"

Then above answers should work.

Hope I'll save someone a day of googling the same stuff.

like image 21
Karolis Šarapnickis Avatar answered Sep 29 '22 04:09

Karolis Šarapnickis


I have found the answer. The key to the solution is grouping the elements inside a row together.

  1. Remove all the static text labels. Use text fields instead, with the text in quotes. They can be grouped with other text fields and data fields.
  2. Put all the data fields after the quoted text field in the same group as the quoted text field.
  3. Now, do the same with all the rows that you want to display. Separate group for individual row.

Select all the elements in a group, or, all the elements in all the gorups and do this:

  • Set "Position" to "Float"
  • Set "Stretch Type" to "Relative to the tallest object"
  • Check "Print when detail overflows" checkbox.
  • Check the "Stretch with overflow" checkbox.

That's all we can do to make things "stretch" together.

Now, the band would have to stretch dynamically with these stretched details. Just go to the band properties, set Split type to "Default" and split allowed to true. This did the trick for me.

like image 114
Rachcha Avatar answered Sep 29 '22 03:09

Rachcha