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.



  1. Auto-generated SQL when a report is executed and will vary from report to report.
  2. 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)
  • User supplied value entered by the Report Consumer for the "Report Name" parameter defined on this example report
  • Exact command text as defined and stored for this report.  This section is not modified by QuickReportz and represents exactly what was entered/stored by the report designer.  After debugging in an external tool this is the only section that should be copied back into QuickReportz