Hello, I want to group by the top table → bottom table. But I don’t know how to group it.
I try but it not work as my expect
(From p In VoucherDT.AsEnumerable()
Group By
x = New With { Key.a = p.Item(“Manager Account”)}
Into Grp = Group
Select VoucherApprovedDT_GroupBy.LoadDataRow (New Object() {Grp(0),
String.Join(“,”,Grp.Select(Function(c) c(“Request Account”))),
String.Join(“,”,Grp.Select(Function(c) c(“Request Date”))),
String.Join(“,”,Grp.Select(Function(c) c(“Voucher No”))),
String.Join(“,”,Grp.Select(Function(c) c(“Voucher Type”))),
String.Join(“,”,Grp.Select(Function(c) c(“Amount”))),
String.Join(“,”,Grp.Select(Function(c) c(“Status”)))}, False)).CopytoDatatable
(
From row In dt_Data
Group row By k=row("Manager Account").ToString.Trim
Into grp=Group
Select dt_GroupedData.Rows.Add({k, String.Join(", ",grp.Select(Function(gr) String.Join("-",gr.ItemArray)))})
).CopyToDataTable