The attached image shows the summary view of a grid report that breaks by date/ salesman/ product (in reverse order). In example above, tester 1 -3 are salesmen whilst the products are blanked out

Point (A) - For each date/salesman, onRecord event totals Remittances per Salesman up to that date. so for each record of a salesman for same date, the Remittance column is same. So the total is calculated in Salesman_onGroupBy by the following code:

{sum_quebra_Remittances} = {sum_quebra_Remittances}/{count_quebra};

{sum_quebra_Diff} = {sum_quebra_Remittances} -{sum_quebra_Value};

In Product_onGroupBy I have:

{sum_quebra_Remittances} = '';

{sum_quebra_Diff} = '';

This is working perfect.

Problem:

Point (B) - On each date break, it is supposed to total Remittances for each salesman so in Date_onGroupBy I have:

{sum_quebra_Remittances} = [totalremit];

{sum_quebra_Diff} = {sum_quebra_Remittances} - {sum_quebra_Value};

and also in SalesmanID_onGroupBy I have:

[totalremit] += {sum_quebra_Remittances};

Problem is that it is putting the sums in the wrong place e.g.

sum of Remittances on 31/1/13 should be 100+26,000+10,00 = 36,100. But it puts zero in totals for 31/1/13 and then puts 36,100 for the next date which is 11/02/2013.

On 12/02/2013, the sum should be zero but it puts 50,000.

So the SC is printing break totals before the page breaks instead of after.

How do I get the correct behaviour please?

Point (A) - For each date/salesman, onRecord event totals Remittances per Salesman up to that date. so for each record of a salesman for same date, the Remittance column is same. So the total is calculated in Salesman_onGroupBy by the following code:

{sum_quebra_Remittances} = {sum_quebra_Remittances}/{count_quebra};

{sum_quebra_Diff} = {sum_quebra_Remittances} -{sum_quebra_Value};

In Product_onGroupBy I have:

{sum_quebra_Remittances} = '';

{sum_quebra_Diff} = '';

This is working perfect.

Problem:

Point (B) - On each date break, it is supposed to total Remittances for each salesman so in Date_onGroupBy I have:

{sum_quebra_Remittances} = [totalremit];

{sum_quebra_Diff} = {sum_quebra_Remittances} - {sum_quebra_Value};

and also in SalesmanID_onGroupBy I have:

[totalremit] += {sum_quebra_Remittances};

Problem is that it is putting the sums in the wrong place e.g.

sum of Remittances on 31/1/13 should be 100+26,000+10,00 = 36,100. But it puts zero in totals for 31/1/13 and then puts 36,100 for the next date which is 11/02/2013.

On 12/02/2013, the sum should be zero but it puts 50,000.

So the SC is printing break totals before the page breaks instead of after.

How do I get the correct behaviour please?

## Comment