Forena Reports is built of the idea of using SQL to get data out of a database and use XHTML and CSS to format it into web reports.
And there is a drupal module for it. Means that there is already something solved the drupal way.
But as per your specific requirements, the module might be reengineered and adopted to the reporting system.
I'm an experienced drupal programmer and would be glad to discuss in detail the requirements and terms.