I've written a custom report, lots of trial and mostly error. One of the columns is group. Since we have almost 300 groups, I'd like to limit the groups the user can include in the report to a subset. (Only certain groups make sense with this report and no one wants to wade through 300 groups to find the several they want.)
Clearly using filters in the _columns is the way to go but I'm not sure just what to put where. I've found examples of hard coded values but I'd like a bit of sql. Maybe there are some examples that my grep didn't find of sql statements.
Here is the basic sql I'd like to use. Maybe it only needs to return the id instead of the title.
select g.title from civicrm_group g, civicrm_group_nesting n where g.id = n.child_group_id and parent_group_id in (124, 125)
The report already limits the groups to these but users may only want one or two groups and not the full 20 or so groups the defaults return.
buildForm
function.