I wanted to do the same thing in the past but ended up creating an external python script.
Phil has confirmed that it is not possible to have dynamic columns in the Reporting Module but there is a workaround:
How to manage the table component of a report when column number can change at runtime - Ignition - Inductive Automation Forum