| 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 | 0 | super(beanCollection); |
| 22 | 0 | } |
| 23 | |
|
| 24 | |
protected Object getFieldValue(Object bean, JRField field) throws JRException { |
| 25 | 0 | Object object = getBeanProperty(bean, getPropertyName(field)); |
| 26 | |
|
| 27 | 0 | if ("subset".equals(field.getName())) { |
| 28 | 0 | return new JRBeanCollectionDataSource((Collection) object); |
| 29 | |
} |
| 30 | 0 | return object; |
| 31 | |
} |
| 32 | |
|
| 33 | |
} |