1

I am new to JasperReports. I am trying to design a table with 2 columns. First Column -> Labels, 2nd Column -> Respective field values

Here "text field data" is dynamic and it can be of any size. So I have specified text fields and respective Static Text as "float". For Text Fields I have specified "stretch with over flow to Yes". Also some elements are printed conditionally. Please refer attached jrxml for more info. (this is smaller chunk of xml I have prepared to demonstrate my issue.)

My issues are

  1. Some times, the last two lines are not printed at all, though they are set to print always. Hieght of the element is not proper. See Issue-1.png

  2. Height of the elements in same row is not same. Please see Issue-2.png

Please refer attachments here.

I would appreciate if you can help me to fix these issues.

Alex K
  • 22,315
  • 19
  • 108
  • 236
Hari_639
  • 101
  • 1
  • 11

2 Answers2

1

After taking a quick view of your jrxml, i can say that the resolution of the second problem might be simply change the stretchType option of the elements. I see all have a value of "RelativeToBandHeight". Try to set them as "RelativeToTallestObject" instead. This will ensure you that elements on the same line (y axis) to have the same height. As for the first problem, of the high height of the elements, i think might be related to "RelativeToBandHeight" as well. Also another suggestion, having all the code to view is difficult to notice the related problem of just one section. You might post just the xml of a single line where the problem occurres.

Endrik
  • 2,238
  • 3
  • 19
  • 33
  • Setting stretch type to "RelativeToTallestObject" is ensuring to display all elements in same row to use same height. But it is causing all elements to display with the height of tallest object. Because of this, all elements/rows are not displaying. Only first few rows are displayed. Looks like the issue is with container frame. It's height is not increasing with child elements height? – Hari_639 Mar 14 '14 at 15:26
1

I followed the technique refereed in this question

I have kept each row/line in individual frame. I have given border to this frame. And to get table look, I have given border to field as (which can expand with data) and kept border width as 0.5

This has fixed all the issues.

Community
  • 1
  • 1
Hari_639
  • 101
  • 1
  • 11