Define reports as json objects and this scripts generates the SQL query