Composing MAReport

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Composing MAReport

David Farber-3
Is it possible to compose an MAReport to use fields from different  
objects?

For example, the person editor exercise has a PersonModel that  
contains an AddressModel.  Right now, an MAReport on the PersonModel  
shows the AddressModel instance as one column.  Would it be possible  
to show only the Country field of the AddressModel (and have the  
columns titled 'Country', not 'Home Address') in the report?

Thanks,
David


_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: Composing MAReport

Lukas Renggli
> Is it possible to compose an MAReport to use fields from different objects?

Yes. You can add columns manually using #addColumnDescription:. Just
make sure that you change the accessor object, so that it reaches the
other object. For example:

aReport addColumnDescription: (MAAddressModel descriptionStreet
     accessor: #(address street);     " calls #address on the
receiver, and on the result #street "
     yourself)

You can also directly add such a description to the PersonModel if you
need it everywhere.

Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch

_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki