Script to get the report.
Non global fields in the header show data from the current record when in browse mode. When you click into the sub summary part, you are getting a different current record where no data is present in those fields. Make those fields global fields or global variables and they won't disappear like that.
Phil, that was quick. My first go-round was with global variables, but then it seems (to me) I couldn't open up more then one report because when I change the variable, even though the correct report would display, both reports had the same value in the header (one was correct, one was incorrect). If I have to live with it, that's ok, I just wont click :)
edit: I fixed it, thanks to your suggestion. First I changed all the variables to global, including the fields in the header. After I changed the fields in the header back it works as expected.
edit of the edit: Oops..spoke too soon. Still disappears when I click.
I figured out a work-around, albeit probably ugly. Based on your comment ...When you click into the sub summary part, you are getting a different current record where no data is present in those fields...I put the start and end fields in the sub-summary part out of view. During the script, after the Perform Find, I put a Replace Field Contents step to populate those fields with the variables. Now it doesn't disappear anymore. I also cleared out the fields when the DB closed.
Don't know if this is the only solution, but it works.
Yep, you just took yourself full circle. A global field or variable is the simplest "fix" but you can't then open different windows to the same report and see different values in those fields. To do that, you'd need to store that data in different records, return separated values in a list, or Field/variable repetitions and use a relationship or calculation to refer to the data so that each window shows different values.