[ 
https://issues.apache.org/struts/browse/WW-2333?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44583#action_44583
 ] 

Ben Morgan commented on WW-2333:
--------------------------------

As I understand it, to view collections in a standalone iReport, you would need 
to perform the extra work of creating a JRDataSource implementation as a source 
for a subreport to view Collection properties of a JavaBean.

A report for Struts2 does not need to do this, as the ValueStackDataSource does 
the lifting for you by creating a JRDataSource for any Iterable property.

So any report with a subreport on a collection that works for standalone 
iReport, will also work for Struts2 - the ValueStackDataSource doesn't 
recognise the JRDataSource property and just passes it through unaffected. The 
opposite is not true, however, I feel that taking this away, forces Struts2 
developers to make reports usable in standalone iReport, where some simply 
don't need that functionality.

> ValueStackDataSource implementation leads to class cast exceptions
> ------------------------------------------------------------------
>
>                 Key: WW-2333
>                 URL: https://issues.apache.org/struts/browse/WW-2333
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - JasperReports
>    Affects Versions: 2.0.11
>            Reporter: Thorsten Schäfer
>             Fix For: Future
>
>
> Assume you have a class Foo that has a Collection of Bar's. Without using 
> Struts, the expected behavior of a report that takes Foo's as input is, that 
> a reference $F{bar} returns a java.util.Collection (of Bar's). However, this 
> will not be the case when using the ValueStackDataSource implementation; an 
> instance of ValueStackDataSource is returned instead of a collection. If the 
> method "getFieldValue" gets called, it checks if the field value is 
> iteratable (which is true for collections) and then returns a new 
> ValueStackDataSource instead of the field value itself. I assume that this 
> behavior breaks many reports.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to