formatting data for pdf generation with headings in a single line