Are you asking on how to get the SQL equivalent of a Web base report? or you are asking on how to put an SQL query to generate a report?
The first - old report writer had an option to show the SQL that generated the report. Where is that functionality in the new report writer?
now, there are 2 types of report Origin - Web base and Report Writer (viewed from Orion web console).
To view the SQL content of Report Writer Origin report - you can still view it on Report Writer (RDP Orion Server >> Report Writer >> select the report >> Report (menu bar) >> show SQL).
For Web base report origin - there is no way at the moment to view the SQL content. I suggest you can submit it as a feature request
You can surely get the SQL query from a web based report by following the below steps.
As normally, we can get the SQL query details of which is made in "report witter", Go to sql tab and get the query details.
But below is the step, it helps we can get the SQL query details which is being used by "Web Based" report.
1) Log on to the Solarwinds Server
Open Log Adjuster by accessing the directory C:\Program Files (x86)\SolarWinds\Orion and search for Log adjuster
At the Top, Change Hubble Active value to "True"
Now go to the web console and you will see hubble is active on the web interface.
2)View the report in the same way.
Click Details in the red menu bar for Hubble
Scroll to the bottom of the Hubble Details page and you will see the SQL Query which we use to pull the report from the Orion Database.
P.S - After copy and paste the query, please again change the Value in log adjuster from "true" to "false".