Hi friends,
I have a different scenario. Here it goes..
Maximum 3 doctors can verify a test. In an order there could be 'N' number of tests and each test can be verified by max 3 doctors.
Suppose in an order there are 10 tests.
Test 1 and Test 2 has been verified by 3 doctors and all are same.
Test 3 is also verified by 3 doctors but different doctors.
Test 4 and Test 5 has been verified by 2 doctors and all are same
Test 6 has been verified by 2 doctors but different doctors
Test 7 and Test 8 has been verified by 1 doctor and is same doctor.
Test 9 is verified by 1 doctor each but different doctors.
Below is the tabular format for the same... My datatable has the similar structure. I am just considering 2 columns here.
ItemID | DocID |
1 | doc 1 |
1 | doc 2 |
1 | doc 3 |
2 | doc 1 |
2 | doc 2 |
2 | doc 3 |
3 | doc 2 |
3 | doc 3 |
3 | doc 4 |
4 | doc 4 |
4 | doc 5 |
5 | doc 4 |
5 | doc 5 |
6 | doc 5 |
6 | doc 6 |
7 | doc 6 |
8 | doc 6 |
9 | doc 7 |
10 | doc 8 |
I need to take print out using crystal reports based on below condition.
1. All the tests having 3 same doctors should be grouped and at the end of the group, need to display the 3 doctors (Test 1 and Test 2 should be displayed first)
2. All the tests having 3 doctors but different doctors should come next and at the end of the group, need to display the doctors (Test 3 should be displayed in second place)
3. All the tests having 2 same doctors should be grouped and at the end of the group, need to display the 2 doctors (Test 4 and Test 5 should display in 3rd place)
It continues till all the tests are printed.
Please help me with the logic.
Many thanks in advance
-- Haritha