What is jasper report's algorithm for using a data source?

Posted by spderosso on Stack Overflow See other posts from Stack Overflow or by spderosso
Published on 2010-04-28T21:39:37Z Indexed on 2010/04/29 2:07 UTC
Read the original article Hit count: 276

Filed under:
|

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!

© Stack Overflow or respective owner

Related posts about java

Related posts about jasper-reports