org.kuali.student.common.ui.server.screenreport.jasper
Class KSCollectionDataSource

java.lang.Object
  extended by net.sf.jasperreports.engine.data.JRAbstractBeanDataSource
      extended by org.kuali.student.common.ui.server.screenreport.jasper.KSCollectionDataSource
All Implemented Interfaces:
net.sf.jasperreports.engine.JRDataSource, net.sf.jasperreports.engine.JRRewindableDataSource

public class KSCollectionDataSource
extends net.sf.jasperreports.engine.data.JRAbstractBeanDataSource

This class overwrites the common JRBeanCollectionDataSource in order to return a JRDataSource to be used on the subreport when the field is called "subset".

Author:
Kuali Rice Team (kuali-rice@googlegroups.com)

Field Summary
private  ExportElement currentBean
           
private  Collection<ExportElement> data
           
private  Iterator<ExportElement> iterator
           
private  ExportElement parent
           
 
Fields inherited from class net.sf.jasperreports.engine.data.JRAbstractBeanDataSource
CURRENT_BEAN_MAPPING, FIELD_DESCRIPTION_PROPERTY_NAME_PROVIDER, FIELD_NAME_PROPERTY_NAME_PROVIDER, propertyNameProvider
 
Constructor Summary
KSCollectionDataSource(Collection<ExportElement> elements, ExportElement parent)
           
 
Method Summary
 net.sf.jasperreports.engine.data.JRBeanCollectionDataSource cloneDataSource()
          Clones this data source by creating a new instance that reuses the same underlying bean collection.
 Collection getData()
          Returns the underlying bean collection used by this data source.
protected  Object getFieldValue(ExportElement bean, net.sf.jasperreports.engine.JRField field)
           
 Object getFieldValue(net.sf.jasperreports.engine.JRField field)
           
 int getRecordCount()
          Returns the total number of records/beans that this data source contains.
 void moveFirst()
           
 boolean next()
           
 
Methods inherited from class net.sf.jasperreports.engine.data.JRAbstractBeanDataSource
getBeanProperty, getFieldValue, getPropertyName, isCurrentBeanMapping
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

data

private Collection<ExportElement> data

iterator

private Iterator<ExportElement> iterator

currentBean

private ExportElement currentBean

parent

private ExportElement parent
Constructor Detail

KSCollectionDataSource

public KSCollectionDataSource(Collection<ExportElement> elements,
                              ExportElement parent)
Method Detail

next

public boolean next()

getFieldValue

public Object getFieldValue(net.sf.jasperreports.engine.JRField field)
                     throws net.sf.jasperreports.engine.JRException
Throws:
net.sf.jasperreports.engine.JRException

getFieldValue

protected Object getFieldValue(ExportElement bean,
                               net.sf.jasperreports.engine.JRField field)
                        throws net.sf.jasperreports.engine.JRException
Throws:
net.sf.jasperreports.engine.JRException

moveFirst

public void moveFirst()

getData

public Collection getData()
Returns the underlying bean collection used by this data source.

Returns:
the underlying bean collection

getRecordCount

public int getRecordCount()
Returns the total number of records/beans that this data source contains.

Returns:
the total number of records of this data source

cloneDataSource

public net.sf.jasperreports.engine.data.JRBeanCollectionDataSource cloneDataSource()
Clones this data source by creating a new instance that reuses the same underlying bean collection.

Returns:
a clone of this data source


Copyright © 2004-2011 The Kuali Foundation. All Rights Reserved.