# Crystal Reports Cross-Tab

Hello,

I was asked to create a report which summarizes the sum of checks, the count of the customers paid the checks, and the count of the checks which are due within the selected month and year. Also, I was asked to make the summary divided into periods for example 5 days. In this case, the report should show the sum of checks, the count of the customers paid the checks, and the count of the checks which are due in November 2014. The summary is divided into periods of 5 days as the following: If the period is 10 days, the report will be as the following: I used the following formula as Cross-Tab Columns Formula:

Ceiling (day({Command.CheckDate})/{?days}) // This formula name is d which will be used in another formula later

Day Formula (d)     Day Formula (d)      Day Formula (d)
1 1 11 3 21 5
2 1 12 3 22 5
3 1 13 3 23 5
4 1 14 3 24 5
5 1 15 3 25 5
6 2 16 4 26 6
7 2 17 4 27 6
8 2 18 4 28 6
9 2 19 4 29 6
10 2 20 4 30 6
31 7

Here is the result: To make the column header more meaningful, I added the following formula into the Cross-Tab Group Options > Group Name Formula as shown in the screenshot: // The first day in the period = the last day in the month then show only that day for example 31

CSTR(({@d}-1)*{?days}+1,0)

// The last day in the period > The last day in the month then show the beginning of the period with ++ for example if the period is 7 days then the last period will be 29++

CSTR(({@d}-1)*{?days}+1,0)+”++”

Else

CSTR(({@d}-1)*{?days}+1,0)+”-“+Cstr(({@d})*{?days},0)

The final result as the following: Best regards,

Alaa

/      