Lists Export (csv and pdf) and url group_by

arie

Member
Hello,

I manually use url group_by fixture to display records grouped by something. Here is the url
Code:
?resetfilters=1&clearordering=1&clearfilters=0&group_by=ass_donator___assoc_donator_id&order_by=ass_donation___donator_id&%2Cass_donation___assoc_donation_id&order_dir=asc&%2Casc

The result is fine however, when I export that grouped_list list, the export display the list without the grouped records.

Any thoughts?
 
Not sure what you mean by "without the grouped records"?

I may be wrong, but I don't think we apply grouping to the query that generates CSV export data, as it's a visual list display artifact, not something we can really represent in a CSV.

-- hugh
 
You are correct Hugh - csv group by doesn't make a lot of sense. I would use an order by for the export, that's about as close as you could get with respect to a CSV format
 
The source of my semi-confusion about this question is that the term "group by" means two different things, with respect to an actual MySQL query, and the way we group data in a list.

In pure MySQL query terms, "group by" boils the rows down to one row per group'ed field (like "SELECT company, SUM(sales) as monthly_sales FROM company_sales GROUP BY company_name"), whereas when we talk about "group by" in terms of the list display, it's a visual artifact where we split the list into sub-tables, but still show all the rows. So it's really an "order by", with each ordered value in its own <thead> (with the template summary in it) and a <tbody> with the data.

So yeah. Ordering makes sense in CSV export, but not "grouping", as there is no concept of 'head' and 'body' in CSV's, beyond the standard single "heading row".

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top