this worked great.

public static Callable<File> createMeetingCheckListReportTask(MeetingChecklist 
b) {
                
String reportDescription = "Printed Meeting Checklist";
        
HashMap<String, Object> parameters = new HashMap<String, Object>();
parameters.put("reportDescription", reportDescription);
parameters.put("userName", "User From session");

EOQualifier accomplishQualifier = 
ERXQ.equals(Accomplishment.MEETING_CHECKLIST_KEY,  b);

@SuppressWarnings("unchecked")
ERJRFoundationDataSource accomplishDataSource = new 
ERJRFoundationDataSource(Accomplishment.fetchAccomplishments(ERXEC.newEditingContext(),
 accomplishQualifier, null));
                
parameters.put("accomplishments", accomplishDataSource);
                
EOQualifier qualifier = ERXQ.equals(MeetingChecklist.CREATION_DATE_KEY, 
b.creationDate());              
ERXFetchSpecification<MeetingChecklist> fs = new 
ERXFetchSpecification<MeetingChecklist>(MeetingChecklist.ENTITY_NAME, 
qualifier, null);
ERJRFetchSpecificationReportTask reportTask = new 
ERJRFetchSpecificationReportTask(fs, jasperMCLCompiledReportFileName, 
parameters);
                                
return reportTask;
}

so in iReport

accomplishments ==  er.jasperreports.ERJRFoundationDataSource@79447bb5

and I used accomplishments as the datasource for the subreport. Of course I had 
to tell iReport that accomplishments' parameter class is java.lang.object

then I created the 'accomplishments' parameter in the primary iReport and 
created a subreport that uses 'accomplishments' as the JRDataSource.

thanks for your help pointing the way


Ted



--- On Tue, 5/8/12, Ralf Schuchardt <[email protected]> wrote:

> From: Ralf Schuchardt <[email protected]>
> Subject: Re: JasperReport and a to-many relation
> To: "Theodore Petrosky" <[email protected]>
> Cc: [email protected]
> Date: Tuesday, May 8, 2012, 11:51 AM
> 
> Am 08.05.2012 um 17:14 schrieb Theodore Petrosky:
> 
> > When I print my iReport and use a field name that
> refers to my to-many relation, I get:
> > 
> >
> com.webobjects.eocontrol._EOCheapCopyMutableArray[1259578d]
> > 
> > If I read this correctly, the JRDataSource doesn't have
> the array, it has the item that would fault to get the
> referred to items.
> > 
> > So I need to create a second JRDataSource with this
> query to feed to the JasperReport.
> > 
> > Anyone have experience with this?
> 
> Yes, we create JRDataSources for these relationships and
> pass them as parameters to JasperReport. In the main report
> those datasources are then passed to subreports to create
> the actual output.
> 
> Ralf
> 
> 
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to