I have the requirement as below, any help to address this in easier way is much appreciated
need to split the Material as batches
Eg1
If Split Material per batch as 5 then as the total no.of record count in the below table is 10 we should update 1st 5 materials as 1 the subsequent 5 materials as 2
Batch
Material
1
M1
1
M2
1
M3
1
M4
1
M5
2
M6
2
M7
2
M8
2
M9
2
M10
Eg2
If Split Material per batch as 3 then as the total no.of record count in the below table is 10 we should update 1st 3 materials as 1 the subsequent 3 materials as 2 and so on
Thanks @Anil_G and @lrtetala for your help. I am getting the chunk as required.
However one small query , the original DT is as below (Batch column values not updated) , we have to update that based on the Group count value which comes dynamically.
DT Initial State:
Batch
Material
M1
M2
M3
M4
M5
M6
M7
M8
M9
M10
DT after gGropu Count is provided: eg if Group Count is provided as 5 then the 1st set of 5 materials should have value 1 and the next set should be incremented and should have value as 2
Batch
Material
1
M1
1
M2
1
M3
1
M4
1
M5
2
M6
2
M7
2
M8
2
M9
2
M10
I am assigning like below
currentItem.Columns(Batch).Expression = counter.ToString (counter is maintained to assign the batch number)
is there any way to assign the values directly to Main DT in the loop or I have to build a DT and append the currentItem records to it each time ?