What is jasper report's algorithm for using a data source?
- by spderosso
Hi,
I have created my custom data source by implementing the interface JRDataSource. This interface looks like this:
public interface JRDataSource
{
 /**
  * Tries to position the cursor on the next element in the data source.
  * @return true if there is a next record, false otherwise
  * @throws JRException if any error occurs while trying to move to the next element
  */
 public boolean next() throws JRException;
 /**
  * Gets the field value for the current position.
  * @return an object containing the field value. The object type must be the field object type.
  */
 public Object getFieldValue(JRField jrField) throws JRException;
}
My question is the following: In what way does jasper report call this functions for obtaining the fields in the .jrxml.
E.g:
  if( next() )){
     call getFieldValue for every field present in the page header 
     while( next() ){
       call getFieldValue for every field present in detail part
     }
     call getFieldValue for every field present the footer
   }
The previous is just an example, experimentally in fact I found out that it is actually not like that. So my question arised.
Thanks!