The error began with this codes
That's why you always need to post exact code and leave nothing out (unless you have tested it and made sure your shown code also contains the problem).
Look at your line 16 and 17.
You begin with an empty array.
You set Header[0] to a fieldtitle.
Then you increate i and want to display Header[1].
But Header[1] isn't filled yet so it's empty so your line 18 shows an empty text.
Move the i := i + 1 to under Q.Next and it should show the correct texts.