Then you can hide the other items in the same script
p = grp == report.last_grp ? 0 : 1;
report.controls.fieldGroup.print = p;
report.controls.lblGroup.print = p;
report.controls.lineGroup.print = p;
I couldn't get this to work.
As I said before, I got it working by adding some stuff to the query, and I'm tired of messing around with these alternate solutions.
But what is really needed is a comprehensive guide to using these javascript scripts, including a complete object model reference. Otherwise, we're just shooting in the dark trying these various snippets that are posted here.