struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Harland <harlander3...@yahoo.com>
Subject Jasper reports plugin problem
Date Tue, 27 Apr 2010 21:42:47 GMT
Hi,

I have been having problems with iterations within sub reports within jasper reports.

I have found the solution to this problem is for ValueStackDataSource to implement JRRewindableDataSource
instead of JRDataSource and implement the method below.

Could this fix be added instead of me having to add this fix for every new build.

Many thanks.

David.

implement moveFirst with something like 

	public void moveFirst() throws JRException {
		Object dataSourceValue = valueStack.findValue(dataSource);
		if (dataSourceValue != null) {
            if (MakeIterator.isIterable(dataSourceValue)) {
                iterator = MakeIterator.convert(dataSourceValue);
            } else {
                Object[] array = new Object[1];
                array[0] = dataSourceValue;
                iterator = MakeIterator.convert(array);
            }
		} else {
			LOG.warn("Data source value for data source " + dataSource + " was null");
		}
	}


      

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Mime
View raw message