I went in and redefined the report again. Got it the way I wanted it. And I had NOT deleted the previous one. I went back to look at it again and it displayed correctly!
What could I have done? This is the correct report. What could have made it display as above?
You have sub summary layout parts.
They require a specific sort order to be visible.
Go to the layout and enter layout mode.
Double click the sub summary part's label.
You'll see that there is a "when sorted by" setting that names a specfiic field. The part will only be visible when your sort order includes that field.
You are absolutely right! Thank you so much.
Is there any way I could edit the script such that it would make sure the records were sorted correctly before running the report script?
You can include a sort records step in your script to specfiy a sort order that is correct for your report layout.