Either you didnt show the entire template or your syntax for the custom report is wrong. You are missing the layout format and the Table header format lines.
Look here for better understanding of how to build them and then read the previous link I posted.