Print the Unit Subtotals End of the report

w2vijay

w2vijay

Well Known Member
Hi,

There is report requirement to display Sales person commision per business unit. Below is the example I am giving like sales person 100,111 and units 170,172,173. Altough Unit totals are dislayed at footer need to display unit grand totals at the end. Example given after the dotted line.

One solution is to capture the subtotals into work file and display them at the end.

Can anyone give solution without using work file and only event rules.


SalPer, GrsAmt, Comm, Bill, Unit
100 200.00 2.75 31 172
100 420.00 21.00 1 172
620.00 23.75 32 Sales man 100 - Unit 172 total

100 999.00 8.00 1 173
100 999.00 8.00 1 173
1998.00 16.00 2 Sales man 100 - Unit 173 total
2618.00 39.75 34 Sales man 100 grand total

111 999.00 6.00 0 170
111 999.00 6.00 0 170
1998.00 12.00 0 Sales man 111 - Unit 170 total

111 999.00 6.00 31 172
111 999.00 6.00 31 172
1998.00 12.00 62 Sales man 111 - Unit 172 total
3996.00 24.00 62 Sales man 111 grand total
6614.00 63.75 96 Grand total - SalesMan, Units
--------------------------------------------
1998.00 12.00 0 Total comm 170 unit
2618.00 35.75 94 Total comm 172 unit
1998.00 16.00 2 Total comm 173 unit
 
I guess I would first ask - Why the requirement to not use a work file? We use work files for mainly one purpose --- to get around the fact that we do not have arrays in our language, so the two obvious alternatives are:

1) Create some caching functions to store the information in memory. (Clearly harder than a work file.)
2) Create enough report variables to store the Salesperson and the interim Sales Commission total for each of the Salespersons that you expect to have. If the total will always be less than 20 then that would be do-able.

Ben again,
 
Thanks Ben,

Completed the requirement with work file. I am poor in coding cache functions.
 
You should have used Level breaks to achieve the same.
Have your level break footer in following EMP and then BU

Use aggregates to get the totals.
 
Back
Top