There may be many approaches :
1. Assume you take 2 local variables like PreviousCusotomerName or PreviousCustomerId and PreviousOrderId. Now when enter first record, values will be like this :
PreviousCustomerName = DEF , PreviousOrderId = 125
Now when writing second record, we apply condition like this If Current Customer Name == PreviousCustomerName, leave blank other wise write value in customer Name column. Same logic can be follow for customerAddress. Same logic we can follow for orderId.
Also in a record list we can access, next or previous record like this :
current record : list.current.customerName
next record : list[current+1].customerName
previous record : list[current-1].customerName
But in this you need to keep the track of list length, otherwise you will get indexOutofBound exception.
Hope this helps, if still facing difficulty let me know.
Regards