You want to write a custom report designer? If so, it has nothing to do with SQL queries. The Cognos SDK comes with some documentation on their Report Specification markup. We have some "auto" report authoring functionality in our application and it is really nothing more than writing XML and importing it into the Content Store via the SDK. The only queries involved are those used in the report for custom Data Query Subjects to bypass your model (if you do that kind of thing)... but again, it is still wrapped in XML.