sheltermanager / asm3

Animal Shelter Manager
GNU General Public License v3.0
109 stars 67 forks source link

Group support for report HTML generator and querybuilder #1554

Open bobintetley opened 1 month ago

bobintetley commented 1 month ago

Have a "Group" option in the query builder. Show an error if the first fields in the Sort/Order By don't match the group.

Group is optional. When grouping is selected, it writes the group to a comment in the resulting SQL - a comment that would be very easy to do by hand without the query builder.

When the HTML generator code runs, if the group comment is present, it is evaluated and the grouping levels written before the $$BODY section. The last $$GROUP section will contain the table header and footer for the body section instead of the $$HEADER. Each group section will have <h2>$FIELD</h2> with h2 increasing for each grouping level (so grouping level 1 is h2, grouping level 2 is h3, etc). The footer will have <h2>$FIELD total: {COUNT.FIELD}</h2>

This will make it a lot easier for us to generate the HTML for groups instead of having to do it by end, and it will make it possible for people using the query builder.