Example #1
0
  public void rewind() throws JRException {
    if (dataSource != null) {
      if (dataSource instanceof JRRewindableDataSource) {
        if (log.isDebugEnabled()) {
          log.debug("Rewinding the list data source");
        }

        ((JRRewindableDataSource) dataSource).moveFirst();
      } else {
        log.warn("Cannot rewind list data source as it is not a JRRewindableDataSource");
      }
    }
  }
  public void rewind() throws JRException {
    if (subreportFiller == null) {
      return;
    }

    cancelSubreportFill();

    initSubreportFiller(null); // FIXME used cached evaluator

    if (getConnectionExpression() == null && dataSource != null) {
      if (dataSource instanceof JRRewindableDataSource) {
        ((JRRewindableDataSource) dataSource).moveFirst();
      } else {
        //				if (log.isWarnEnabled())
        //					log.warn("The subreport is placed on a non-splitting band, but it does not have a
        // rewindable data source.");
        throw new JRException(
            "The subreport is placed on a non-splitting band, but it does not have a rewindable data source.");
      }
    }
  }