get sql for users report

get sql for users report

by Tom Tom -
Number of replies: 3

I'm working on a site that users configurable reports. I go to the manage reports page and see all the reports (users, sql, etc) listed. But if I click on the cogwheel/edit icon I don't see the sql for the sql reports and I do not see the columns for the users reports. So I don't know how to edit them. And specifically I don't see a way to get the sql for the users/column-selected reports. Is there a way? In the documentation I just see how to create configurable reports.

Average of ratings: -
In reply to Tom Tom

Re: get sql for users report

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
Screenshot? What exactly do you see?
In reply to Emma Richardson

Re: get sql for users report

by Tom Tom -

I see the typical configurable reports block with the list of reports and then the "======" and "Manage reports" under it. I click "Manage reports". I then (on the configurable_reports/managereport.php page) I see a table of the report name, manage reports course, type of report, username, edit (icons), and download columns. In the edit column if I click the cogwheel/edit icon next to the report I'm particularly interested in (Users report, not SQL) I am taken to a typical Moodle mform page with the following tabs at the top: View report, columns, conditions, ordering, filters, template, permissions, calculations, plot-graphs, report, and manage reports. I don't see anything that tells me what the SQL is that the plugin/moodle is using to create the report.

In reply to Tom Tom

Re: get sql for users report

by Thomas Stanley-Jones -
Correct, the non-sql reports don't have sql available to edit or see. To figure out how to make a SQL report, I use Adminer (a different plugin) to see tables and their contents, and then through a process of trial and error, I get the report I'm looking for. i find the non-sql reports are too limiting for the clauses and filters that I want to implement. That might be because I haven't spent the time on them too.
Average of ratings: Useful (2)