I cheated....

The header is static, so I wrote the header outside the main While loop.

I might go back and revisit this later, but I was getting coding headaches in between everyone coming to my desk and hassling me for other jobs.

Pax