2001 JI Open Discussion Posted August 21, 2006 Share Posted August 21, 2006 By: Francisco - kjava2 Sending a Collection insteand of a Connection 2005-06-22 05:58Hello all, I would like to ask if anyone knows how I could send a Collection to the report insteand of seding a Connection or a JRResultSetDataSource. My problem is that I have a result of 2 ResulSet and I need to create the report of them. I would like to do something like this: public class BeanPessoa implements Serializable { String nome; int idade; public BeanPessoa(int idade, String nome){ this.idade=idade; this.nome=nome; } public void setNome(String p){ this.nome=p; } public void setIdade(int p){ this.idade=p; } public String getNome(){ return this.nome; } public int getIdade(){ return this.idade; } } ArrayList<BeanPessoa> listaPessoa = new ArrayList<BeanPessoa>(); listaPessoa.add(new BeanPessoa(10,"Pedro")); listaPessoa.add(new BeanPessoa(15,"Maria")); listaPessoa.add(new BeanPessoa(22,"Roberto")); listaPessoa.add(new BeanPessoa(16,"Luiz")); I needed the report could read the FIELD [idade] and [nome] for each item in the Collection as it was a ResultSet. Is that possible? Or is there any other way to send result of 2 ResultSet to a report? Thanks a lot Francisco - Brazil By: Franco Weichel - franco_weichel RE: Sending a Collection insteand of a Connec 2005-06-28 10:11Look at the Data Source sample. It does exactly what you are looking for. Franco By: AlperULUSOY - taramakalemi RE: Sending a Collection insteand of a Connection 2005-07-04 03:22http://geocities.yahoo.com.br/robertofurutani/java/Tutorial_JasperReports/ its in Portuguese but ithink it will be helpful.. 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