I'm using Jasper report 5.2, iReport 5.2 and exporting the report in RTF and PDF formats.
In my report I want to add few text fields along with their (static text)labels aligned horizontally like
Name: $F{name}
Age: $F{age}
Date of Birth: $F{dateOfBirth}
But I'm unable to align them. This is what I tried
- Position Type: float (for all static text and fields)
- Stretch Type: no stretch (for all static text and fields)
- Stretch With Overflow: True (for all dynamic text fields)
The image shows what I get and what I want.
Moreover, my text field's content is dynamic i.e. content size could vary.
I've read many forums but could not find a solution, please suggest.
Thanks
Best Answer
It can be easily done with help of container - the Frame element.
You should put Frame with Position Type as Float and put to them both staticText (label) and textField.
For textField I've set Position Type as Float the Stretch With Overlfow as true.
The sample
The jrxml file:
The report's design in iReport:
The result will be (via iReport preview):