Hi Paul,

I've refactored the report generation in one of applications lately to use a 
background task. A few lessons that I learned:

1) Do not create the editing context you're going to use in the background task 
during the request-response cycle.

2) Do not pass EOs to the background task. Only EOGlobalIDs.

3) Do not reference the WOSession, WORequest, WOContext from the background 
task.

4) Create a new WOResponse to return the report.

5) You can pass a Map as parameter when generating Jasper reports. I don't how 
this could relate to your need to perform a dictionary preparation.

I also had trouble locking the editing context in the background task, but I 
have no recommendation on this subject. You must check how your application 
behaves.

In the end, we have created a project (that is probably going to became open 
source) to handle the report generation. You can take a look here [1] for some 
inspiration related to Jasper data sources. Please, be gentle. The code is 
available but it's not completely polished. :)

[1]https://github.com/hprange/woreports/tree/master/src/main/java/com/woreports/jasper

Cheers,

Henrique

On 26/09/2013, at 02:35, Paul Hoadley <pa...@logicsquad.net> wrote:

> Hi Chuck,
> 
> On 26/09/2013, at 12:39 PM, Chuck Hill <ch...@global-village.net> wrote:
> 
>> How about passing in an array of EOs as EOGlobalIDs and a dictionary of 
>> EOGlobalIDs to whatever prepared data (user info) you need?
> 
> That's a good idea.  It still looks like I'll need to abandon the idea of 
> making it sufficiently general to add to ERJasperReports.framework, though.  
> (Since needing to pass in such a dictionary as well seems like a pretty 
> specific requirement, not to mention the issue of what to do with it once it 
> arrives.)  And at that point, I may as well make it completely specialised, 
> including performing the dictionary-preparation steps in the background task.
> 
> 
> -- 
> Paul Hoadley
> http://logicsquad.net/
> 
> 
> 
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/webobjects-dev/hprange%40gmail.com
> 
> This email sent to hpra...@gmail.com

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to