Step one is to create the parameter that we'll need. Right click on the Parameters, add, datatype = integer, add available values for Collapse All (-1) and Expand All (1)

Right click on a line in the Row Groups area (we did the Details line), choose 'visibility', add this formula behind 'show or hide based on an expression:
=iif(Parameters!CollapseorExpand.Value=-1,True,False)
This will show or hide the details row, based on the parameter.
All set!