1 | |
package org.kuali.student.common.ui.server.screenreport.jasper; |
2 | |
|
3 | |
import java.util.Collection; |
4 | |
|
5 | |
import net.sf.jasperreports.engine.JRException; |
6 | |
import net.sf.jasperreports.engine.JRField; |
7 | |
import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource; |
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
|
18 | |
public class KSCollectionDataSource extends JRBeanCollectionDataSource { |
19 | |
|
20 | |
public KSCollectionDataSource(Collection beanCollection) { |
21 | 48 | super(beanCollection); |
22 | 48 | } |
23 | |
|
24 | |
protected Object getFieldValue(Object bean, JRField field) throws JRException { |
25 | 328 | Object object = getBeanProperty(bean, getPropertyName(field)); |
26 | |
|
27 | 328 | if ("subset".equals(field.getName())) { |
28 | 44 | return new KSCollectionDataSource((Collection) object); |
29 | |
} |
30 | 284 | return object; |
31 | |
} |
32 | |
|
33 | |
} |