throw new ExportException(he);
}
reportStream = PdfReportExporter.class.getClassLoader().getResourceAsStream("org/nxplanner/export/reports/JRStory.jasper");
parameters.put("StoryName", story.getName());
Person cust = story.getCustomer(); parameters.put("StoryCustomerName", (cust != null) ? cust.getName() : null);
parameters.put("StoryEstimatedHours", new java.lang.Double(story.getEstimatedHours()));
parameters.put("StoryDescription", story.getDescription());
} else if (object instanceof Task) {
Task task = (Task)object;
try {
ds = new TaskDataSource(task, session);
} catch (HibernateException he) {
throw new ExportException(he);
}
reportStream = PdfReportExporter.class.getClassLoader().getResourceAsStream("org/nxplanner/export/reports/JRTask.jasper");
parameters.put("TaskName", task.getName());
parameters.put("TaskDescription", task.getDescription());
double actual = task.getActualHours();
parameters.put("TaskPercentage", new java.lang.Integer((int)((actual * 100) / (actual + task.getRemainingHours()))));
parameters.put("TaskDisposition", task.getDisposition());
parameters.put("TaskType", task.getType());
parameters.put("TaskAcceptor", getPersonName(session, new Integer(task.getAcceptorId())));
parameters.put("TaskEstimate", new java.lang.Double(task.getEstimatedHours()));
parameters.put("TaskCompleted", new java.lang.Boolean(task.isCompleted()));
} else if (object instanceof Person) {
Person person = (Person)object;
try {
ds = new PersonDataSource(person, session);
} catch (HibernateException he) {
throw new ExportException(he);
}
reportStream = PdfReportExporter.class.getClassLoader().getResourceAsStream("org/nxplanner/export/reports/JRPerson.jasper");
parameters.put("PersonName", person.getName());
}
if (ds == null) {
throw new ExportException("Could not instantiate data source");
}