Closed dxh141130 closed 6 years ago
in OrderRow [Expression("Select SUM(Summa) from [OrderDetail] AS T1 WHERE T0.OrderId = T1.OrderId")] ...... [Expression("Select Count(DetailId) from [OrderDetail] AS T1 WHERE T0.OrderId = T1.OrderId")] .......
in Nortwind Order
[DisplayName("Summ"), Expression("(Select SUM(t1.[UnitPrice] * t1.[Quantity] - t1.[Discount]) from [Order Details] AS t1 WHERE T0.OrderId = t1.OrderId)")]
public Decimal? Summ
{
get { return Fields.Summ[this]; }
set { Fields.Summ[this] = value; }
}
and count
[DisplayName("Count"), Expression("(Select Count(t1.[DetailID]) from [Order Details] AS t1 WHERE T0.OrderId = t1.OrderId)")]
public Decimal? Count
{
get { return Fields.Count[this]; }
set { Fields.Count[this] = value; }
}
Thank you so much. i used to think what i can do is work on one row, now it looks i could write sql query to a field. MANY THANKS
I have primary table order and sub table order detail, one order has mutilple order detail. i want to show the order amount is sum of several order detail amount in order grid. i tried to use expression, but i can not use group by. and i tried to use formatter, editor. I donot know what kind of reason, it does not show error, but the order grid did not show sum order detail amount. Please give me an example about that ,thanks