• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: JasperReport and a to-many relation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: JasperReport and a to-many relation


  • Subject: Re: JasperReport and a to-many relation
  • From: Theodore Petrosky <email@hidden>
  • Date: Tue, 08 May 2012 13:15:37 -0700 (PDT)

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@hidden> wrote:

> From: Ralf Schuchardt <email@hidden>
> Subject: Re: JasperReport and a to-many relation
> To: "Theodore Petrosky" <email@hidden>
> Cc: email@hidden
> 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@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: JasperReport and a to-many relation (From: Ralf Schuchardt <email@hidden>)

  • Prev by Date: Re: JasperReport and a to-many relation
  • Next by Date: D2W delete with to-many
  • Previous by thread: Re: JasperReport and a to-many relation
  • Next by thread: D2W delete with to-many
  • Index(es):
    • Date
    • Thread