Multiline text fields with labels

0

I would like to build report which will look like this:

label 1:  text1 text1 text1

             text1 text1 text1 

label 2:  text2 text2 text2

             text2 text2 text2

 

the labels are taken from resources i18N files.

the text for labels can have multiple lines.

For now I have it work like this (it is consitent of four text fields)

label 1:  text1 text1 text1

label 2:  text1 text1 text1

             text2 text2 text2

             text2 text2 text2

Could you please give me a hint how to achive this ?



Post Edited by lkaleta at 12/31/2011 12:08
lkaleta's picture
Joined: Dec 31 2011 - 3:37am
Last seen: 2 years 8 months ago

8 Answers:

0
Hello lkaleta, What are you naming Label? Are you using text fields or is it the Label for a chart? Raphael
rpeguet's picture
39
Joined: Mar 8 2011 - 2:06am
Last seen: 2 months 4 weeks ago
0
label is TextField, it supposed to be localized -> $R{resource.key} text is also TextField which I do not know how long it will be. So this is like input from html form where user enters data into text area.
lkaleta's picture
Joined: Dec 31 2011 - 3:37am
Last seen: 2 years 8 months ago
0
OK, you may need to use a table element and to set the property of your testField to Stretch with overflow. You may even try to use a Table inside your table and I haven't tested it but you could put that table inside the detail band so that you have your table populated with all the data from your datasource too. This last thing is just a guess though.
rpeguet's picture
39
Joined: Mar 8 2011 - 2:06am
Last seen: 2 months 4 weeks ago
0
As far as I understand, table is for collections while mine is just single POJO with couple String fields (free text), integers and BigDecimals. For mine poje I use report parameters. I do not know how can I use parameters with table.
lkaleta's picture
Joined: Dec 31 2011 - 3:37am
Last seen: 2 years 8 months ago
0
Are you using iReport to build you report?
rpeguet's picture
39
Joined: Mar 8 2011 - 2:06am
Last seen: 2 months 4 weeks ago
0
yes
lkaleta's picture
Joined: Dec 31 2011 - 3:37am
Last seen: 2 years 8 months ago
0
When you drag and drop a Table element from the palette to your report, you can define it's subdataset which includes fields from the datasource, Variables and Paramters. All those can be put in a cell in the table using a single textField. I hope this helps Raphael
rpeguet's picture
39
Joined: Mar 8 2011 - 2:06am
Last seen: 2 months 4 weeks ago
0
rpeguet thanks for your help so far! ok, how can I create table with multiple rows ? Lets say that I have a bean: public class Bean { private String a; private String b; private Integer c; // getter and settter ommited } This single bean is only source of data for report, so I am defining 3 fields in mine report: a, b, c Row 1 -> $R{a.key}, $F{a} Row 2 -> $R{b.key}, $F{b} Row 3 -> $R{c.key}, $F{c} I do not see an option to do that.
lkaleta's picture
Joined: Dec 31 2011 - 3:37am
Last seen: 2 years 8 months ago
Feedback