You can conditionally hide detail reports so this should be possible. There are several examples if you search these forums. When a detail report is hidden the next section automatically moves up.
* Based on a variable - this is for a table but you can use this for the detail report as well: How to define a PixelPerfect DetailReport Visibility via Script (NPrinting)?
* Based on a field value: How to Manage PixelPerfect Conditional Output Formats Using the Formatting Rules Editor
HTH - Daniel.