I am looking for the best way to design a form layout (rather than a listing of detail records) report using the XAF Web Report designer (in a project using Entity Framework). The report is based on a master object that has a collection of items.
Using the below objects as an example, I need to be able to design a form layout report so that it contains some of the fields from "Order", as well as specific items from its child collection(s).
For example:
=============================================
MY REPORT
Order Number: [Order.OrderNumber]
Item1Notes: [Order.Items.DetailItems[1].Notes] Item3Notes: [Order.Items.DetailItems[3].Notes]
Item11Notes: [Order.Items.DetailItems[11].Notes]
=============================================
Example class structure:
C#--------------
Order
--------------
string OrderNumber
ItemList Items
--------------
ItemList
--------------
string ItemListName
int CreatedBy
IList<DetailItem> DetailItems
--------------
DetailItem
--------------
string ItemName
string Notes
Can you suggest the best way to accomplish this?
I though perhaps using a calculated field could work, but I don't see that available in the web XAF Report Designer. Perhaps scripting could work, but I don't see any support for that in the web report designer.
I would prefer to be able to handle this within the report definition somehow, but if that is not possible, could I use the model designer to create some calculated fields that reference an item in a collection (i.e. Order.Items.DetailItems[5].Notes). Finally, if this is an option, is it possible to reference items in a collection by a property value rather than by index? (i.e. somehow use the ItemName => Order.Items.DetailItems[DetailItem.ItemName])
Thanks!
If the objects are joined by relationships then that is easy. Simply use the Field Explorer in the report designer.In your case, if Order and Detailitem is related then if you click the arrow to expand the field you will see the columns. Drag the column you want to the designer surface.