Jump to content
Changes to the Jaspersoft community edition download ×

Getter problems


Recommended Posts

By: Chris - chrispr

Getter problems

2006-06-13 06:27

in my report.jrxml I have the following line

 

<field name="Task" class="java.lang.String"/>

 

My object class and JRAbstractBeanDataSourceProvider subclass are provided below. When I try to compile I get the an error saying that the property 'task' has no getter method. (same goes for 'hours' and 'date')

I'm using JasperReports v1.2.3.

 

 

class OverzichtsRow {

public Date date;

public String task;

public int hours;

 

public OverzichtsRow(Date p_Date, String p_Task, int p_Hours)

{

date = p_Date;

task = p_Task;

hours = p_Hours;

}

public void setDate(Date date)

{

this.date = date;

}

 

public Date getDate()

{

return date;

}

 

public void setTask(String task)

{

this.task = task;

}

 

public String getTask()

{

return task;

}

 

public void setHours(int hours)

{

this.hours = hours;

}

 

public int getHours()

{

return hours;

}

}

 

 

public class WeekOverzichtDS extends JRAbstractBeanDataSourceProvider

{

public WeekOverzichtDS()

{

super(OverzichtsRow.class);

}

 

public JRDataSource create(JasperReport report)

throws JRException

{

ArrayList collection = new ArrayList();

 

collection.add(new OverzichtsRow(Calendar.getInstance().getTime(),

"Task 1", 5));

 

return new JRBeanCollectionDataSource(collection);

}

 

public void dispose(JRDataSource dataSource) throws JRException

{

}

}

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...