I have partly solved my problem in the post "printing groups then detail". In order to display the group headers before the detail I group within my query and return a very wide dataset containing both summary and detail columns. In the summary rows the detail fields are all null, and in the detail rows the summary fields are all null. I can now print all of the summary records at the top by breaking on one of the summary fields and sorting in descending order so the nulls fall underneath.
But now I have to be able to suppress the summary group formatting when the detail records are printed. That is to say, the summary fields of the record will be null, and since the headers use only the summary fields, I should be able to suppress the header bands... except that those bands also contain labels. The labels seem to cause the band to print even if the data fields are empty. How can I get a section to be suppressed if it has labels, but all data fields are null?
But now I have to be able to suppress the summary group formatting when the detail records are printed. That is to say, the summary fields of the record will be null, and since the headers use only the summary fields, I should be able to suppress the header bands... except that those bands also contain labels. The labels seem to cause the band to print even if the data fields are empty. How can I get a section to be suppressed if it has labels, but all data fields are null?