Delphi Clientdataset Search / Aggregate

I need a little help with ClientDatasets in Delphi.

What I want to achieve is a grid showing customers, where one of the columns shows the number of orders for each customer. I put a ClientDataset on a form and load Client.xml from Delphi demo data. Another ClienDataset is loaded using order.xml. In a relatively simple way, I can define an aggregate on CDS orders showing the total amount per customer (or account). (See Cary Jensen's article on this: http://edn.embarcadero.com/article/29272 ) The problem is getting this cumulative result from the order dataset to the customer dataset.

This is a kind of reverse lookup, since there is a 1-n relationship between customers and orders, not n-1, as is usually the case in search scenarios.

Any ideas?

Soren

+2


a source to share


2 answers


Perhaps you can define a calculated field in the customer dataset that simply takes the value of an aggregated field in the orders dataset.



+6


a source


Have you tried to link Master (Clients) - Details (Orders)?
This is not a search situation.



0


a source







All Articles