I need to convert the data like below for reporting, i have tried a lot but not getting success yet.
Original Table:
Id || Id1 || Id2 || MasterId || Obs ||Dec || Act || Status|| InstanceId
1 || 138 || 60|| 1 || Obs1 ||Dec1 || Act1 || 0|| 14
2 || 138 || 60|| 2 || Obs2 ||Dec2 || Act2 || 1|| 14
3 || 138 || 60|| 3 || Obs3 ||Dec3 || Act3 || 1|| 14
4 || 138 || 60|| 4 || Obs4 ||Dec4 || Act4 || 0|| 14
5 || 138 || 60|| 5 || Obs5 ||Dec5 || Act5 || 1|| 14
View For Reporting:
Id1 ||Id2 ||MasterId1 ||Obs1 ||Desc1 ||Act1 ||StatusId1 ||MasterId2 ||Obs2 ||Desc2 ||Act2 ||StatusId2 || MasterId3 ||Obs3 ||Desc3 ||Act3 ||StatusId3 || MasterId4 || Obs4 ||Desc4 ||Act4 ||StatusId4 ||MasterId5 ||Obs5 ||Desc5 ||Act5 ||StatusId5 ||InstanceId
138 ||60 ||1 ||Obs1 ||Desc1 ||Act1 ||0 ||2 ||Obs2 ||Desc2 ||Act2 ||1 ||3 ||Obs3 ||Desc3 ||Act3 ||2 ||4 ||Obs4 ||Desc4 ||Act4 ||0 ||5 ||Obs5 ||Desc5 ||Act5 ||1 ||14