Stretch a row with data overflow while having mult

2019-01-06 13:24发布

问题:

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.

回答1:

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.



回答2:

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.



回答3:

In my case doing as you advised didn't work. I had to modify your solution a little bit - I made a "frame" instead of grouping objects, and put previuosly grouped elements in that frame. I set positionType="Float" and stretchType="No stretch" in that frame, and set stretchType="RelativeToTallestObject" to its child items - then it all works.