1- Login to CABI as "superuser" (default password of "superuser")
If External: http(s)://<cabiServer>:<port>/jasperserver-pro/
or if bundled:
2- Go to the "Manage" menu > "Server Settings"
3- Enable these settings in "Ad-Hoc" settings
4- Run the Ad Hoc Report and when you encounter a slow response, use the "Show SQL" button to see the query:
5- The query can be used in MS SQL Mgmt. Studio (or Oracle SQL Tuning Advisor) to get the explain plan and statistics, as well as index suggestions.