If you want to expand all and collapse all, the simplest method would be to change the body part to a sub-summary part.
Then create a global field radio button with a value list with 2 values-Collapse, Expand-you can call the field Report_sort
On the global field, set an OnObjectModify script trigger that basically says:
If[YourTable::Report_sort = "Expand"]
Sort Records [Sort by both sub-summary parts]
Else If [YourTable::Report_sort = "Collapse"]
Sort Records [Sort by first sub-summary part]
I would also recommend for radio buttons to use Raybaudi's auto enter calculation (uncheck "Do not replace...") to prevent a user from shift + clicking both buttons:
GetValue ( Self ; ValueCount ( Self ) )
Just to add, here's another example where you can collapse just part of the list view;
(I just noticed Mike posted the same link in the first reply). It's pretty complicated and involved.
However if you look in the comment section you'll see this attached file from HOnza which is pretty cool and much simpler to initiate.
Here's it in action in my database: