Create three formulas:
//{@reset} to be placed in the group #1 header:
whileprintingrecords;
numbervar summax := 0;
//{@accum} to be placed in the group #2 footer.
whileprintingrecords;
numbervar summax := summax + maximum({table.amt},{table.voucher}); //where {table.voucher} is your group field
//{@display} to be placed in the group #1 footer:
whileprintingrecords;
numbervar summax;
This will give you a sum of the maximums of group #2 for your outer group #1. You were using the terms for groups in an unusual way. Group #1 is your highest level group, group #2 is nested within Group #1, so I assumed you meant you wanted to sum the maximums for group #2 at the group #1 level. If what you really want is a report total, then you don't need the reset formula, and you would place the display formula in the report footer.
-LB