When a report is executed by the consumer QuickReportz generates a SQL command based upon the defined parameter types along with some additional metadata. Report Editor users can access this generated SQL by clicking the "Show SQL" button after executing a report from the view screen (shown below).
For debugging purposes it is sometimes useful to access this SQL and execute it directly in an external SQL tool such as SQL Management studio. The generated SQL is designed to be executable without any modification when copied into an external tool. This provides a huge advantage over tools such as SSRS where the report designer has to recreate all the parameter tokens for the SQL to function when executed outside of SSRS. This makes it possible to have a workflow where the report definitions can be created,debugged, and fine-tuned in an external tool and then simply copied back into the "Command Text" section in QuickReportz.
The following image shows the generated SQL for a simple report containing only a single parameter called "Report Name" in which the consumer has supplied "Reports" as the value.
- Auto-generated SQL when a report is executed and will vary from report to report.
- Username of the consumer currently executing the report
- This can be useful for implementing custom security schemes or additional audit logs (though security and audit logs are already built-in to QuickReportz generally making this unnecessary)