You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Dave Newton <ne...@yahoo.com> on 2008/01/08 02:55:44 UTC

[S2] JasperReports plugin vs. Subreports

This might be a JasperReports question; not sure yet.

I'm trying to figure out if there's a way I can use sub-reports via the
JasperReports plugin. I have a reasonably complicated data structure with
multiple nested collections.

At this point I might just write XML and use an XML datasource and use JR by
hand, but I'd really like to avoid that if possible.

Thanks,
Dave



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


Re: [S2] JasperReports plugin vs. Subreports

Posted by Dave Newton <ne...@yahoo.com>.
--- Jeromy Evans <je...@blueskyminds.com.au> wrote:
> That's just an issue caused by Jasper Reports 2.0.3 when the way the 
> borders are rendered was changed.  Upgrade to 2.0.4 and it goes away again.

Yep, did that this morning. Now I can go back to what 20 years of experience
has prepared me for.

Laying out a report.

:/

d.


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


Re: [S2] JasperReports plugin vs. Subreports

Posted by Jeromy Evans <je...@blueskyminds.com.au>.
Dave Newton wrote:
> (Well, I get a "illegal operation inside path" error when I open in Reader 7,
> which is, of course, what we're deploying for, but that's a different issue
> :(
>   

That's just an issue caused by Jasper Reports 2.0.3 when the way the 
borders are rendered was changed.  Upgrade to 2.0.4 and it goes away again.
(At the time of writing, 2.0.4 isn't in the mvn repository yet though)
> I've also enhanced the Jasper plugin (gotta remember to check that in :( to
> accept "reportParameters" and "exporterParameters" in the config to define
> two maps for report and exporter parameters; this is generally useful.
>
>   

Great!


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


Re: [S2] JasperReports plugin vs. Subreports

Posted by Dave Newton <ne...@yahoo.com>.
--- Jeromy Evans <je...@blueskyminds.com.au> wrote:
> Did you make any progress with this?

Not particularly. Part of my confusion was syntactical on the Jasper side,
part of it was how our existing data structure was laid out. I created some
lists of "holder" objects and am using the normal collection datasource now.

(Well, I get a "illegal operation inside path" error when I open in Reader 7,
which is, of course, what we're deploying for, but that's a different issue
:(

I've also enhanced the Jasper plugin (gotta remember to check that in :( to
accept "reportParameters" and "exporterParameters" in the config to define
two maps for report and exporter parameters; this is generally useful.

If anybody has any ideas or needs regarding the report or exporter parameters
let me know.

d.


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


Re: [S2] JasperReports plugin vs. Subreports

Posted by Jeromy Evans <je...@blueskyminds.com.au>.
Hi Dave,

Did you make any progress with this?

The approach I've used is for the action to set up a JRDataSource 
instance in a public property.  The DataSource is defined as a normal 
parameter in the Master Report.  The Jasper Result passes this 
JRDataSource instance to the Master report through the parameter and the 
Master report passes the datasource to the subreport through a 
dataSourceExpression.

Although it's possible for the action to setup a 
JRHibernateListDataSource/JRJpaDataSource/other JRDataSource instance, I 
instead created a subclass of JRAbstactBeanDataSource that performs an 
nested iteration over the nested collection(s).  I'm not sure if that 
makes sense - it runs multiple iterators to unroll the nested collection 
as the master collection is iterated over.

This basically means there's no additional code in the action other than 
to define the JRDataSources for the subreports.

I'm interested to hear if you solved it another way.

regards,
 Jeromy Evans


Dave Newton wrote:
> This might be a JasperReports question; not sure yet.
>
> I'm trying to figure out if there's a way I can use sub-reports via the
> JasperReports plugin. I have a reasonably complicated data structure with
> multiple nested collections.
>
> At this point I might just write XML and use an XML datasource and use JR by
> hand, but I'd really like to avoid that if possible.
>
> Thanks,
> Dave
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>
>
>   


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