lkaleta Posted December 31, 2011 Share Posted December 31, 2011 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 text1label 2: text1 text1 text1 text2 text2 text2 text2 text2 text2Could you please give me a hint how to achive this ?Post Edited by lkaleta at 12/31/2011 12:08 Link to comment Share on other sites More sharing options...
Raphaël Peguet Posted January 4, 2012 Share Posted January 4, 2012 Hello lkaleta, What are you naming Label? Are you using text fields or is it the Label for a chart? Raphael Link to comment Share on other sites More sharing options...
lkaleta Posted January 4, 2012 Author Share Posted January 4, 2012 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. Link to comment Share on other sites More sharing options...
Raphaël Peguet Posted January 4, 2012 Share Posted January 4, 2012 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. Link to comment Share on other sites More sharing options...
lkaleta Posted January 4, 2012 Author Share Posted January 4, 2012 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. Link to comment Share on other sites More sharing options...
Raphaël Peguet Posted January 5, 2012 Share Posted January 5, 2012 Are you using iReport to build you report? Link to comment Share on other sites More sharing options...
lkaleta Posted January 6, 2012 Author Share Posted January 6, 2012 yes Link to comment Share on other sites More sharing options...
Raphaël Peguet Posted January 6, 2012 Share Posted January 6, 2012 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 Link to comment Share on other sites More sharing options...
lkaleta Posted January 6, 2012 Author Share Posted January 6, 2012 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. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now