Flattening the data from the database record
I am reading a record grouped by name and then by project name from Sql server DB. The database has records based on year of week. But the report should be based on pay period(dates). I have the logic to filter the data based on input pay period range. I used array to stretch the 3 rows from DB to 1 report row using
if({TimeSheet.Week} = {@beginWk}) then
populate week1 array;
else if({TimeSheet.Week} = {@endWk}) then
populate week3 array;
else
populate week2 array;
TimeSheet.Week - is the databasew field
Then I form the finalHrarray by stretching week1, week2 and week3 based on the pay period range. But in the report under the detail section it displays 3 rows from the DB for the project
like
projectA 0 1 2 3 4 5 0 0 0 0 0 0 0 0 0
projectA 0 1 2 3 4 5 0 0 0 0 0 0 0 0 0
projectA 0 1 2 3 4 5 0 0 0 0 0 0 0 0 1
Somehow it reads only 1 and 3 row and in some case 1 and 2 row. But I want
projectA 0 1 2 3 4 5 0 5 6 7 2 3 0 0 1 All three weeks in 1 row