You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by David Harland <ha...@yahoo.com> on 2010/04/27 23:42:47 UTC
Jasper reports plugin problem
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
Re: Jasper reports plugin problem
Posted by Wes Wannemacher <we...@wantii.com>.
We'd be happy to improve it so that it works for you, but to make it
happen, you should file a JIRA and attach a patch file to the JIRA
issue that fixes the problem. Preferably, implement a unit test as
well...
I'm not trying to make it harder for you to contribute, I'm just
suggesting how to get your change incorporated quickly :)
-Wes
On Tue, Apr 27, 2010 at 5:42 PM, David Harland <ha...@yahoo.com> wrote:
> 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
>
>
--
Wes Wannemacher
Head Engineer, WanTii, Inc.
Need Training? Struts, Spring, Maven, Tomcat...
Ask me for a quote!
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org