2006 IR Open Dicussion Posted August 27, 2006 Share Posted August 27, 2006 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 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