sorting doesn't seem to work inside expanding-reporter
The following code don't work, no way, nohow.
Well, it does work, but the sorting doesn't. By the way, this was originally stolen from the expanding-reporter page on your site - which also didn't work, and changing the prefix comment to content and adding a closing tag to the contained local-reporter didn't help...
The correct fields are being displayed, and the titles are grouped as though they were sorted, but the first letter of each of the first three distinct titles was P, U, and R respectively, and the creation dates of the comments within each page were in no discernible order.
Oh, yes: I'm using Reporting 3.1.0 on Confluence 2.10.3.
Well, it does work, but the sorting doesn't. By the way, this was originally stolen from the expanding-reporter page on your site - which also didn't work, and changing the prefix comment to content and adding a closing tag to the contained local-reporter didn't help...
{report-table}
{expanding-reporter:content:all comments|as=comm}
{local-reporter:children}{local-reporter}
{text-sort:title}
{date-sort:comm>creation date|order=descending}
{expanding-reporter}
{report-column:title=Date}
{report-info:comm>creation date>yyyy.MM.dd}
{report-column}
{report-column:title=Page|width=20em}
{report-info:item > title|link=true}
{report-column}
{report-column:title=Comment Summary}
{report-info:comm> body > first 50|render=wiki}
{report-column}
{report-table}
The correct fields are being displayed, and the titles are grouped as though they were sorted, but the first letter of each of the first three distinct titles was P, U, and R respectively, and the creation dates of the comments within each page were in no discernible order.
Oh, yes: I'm using Reporting 3.1.0 on Confluence 2.10.3.
1
person has this question
I have this question, too!
Tell me when someone answers.
The more people who ask this question, the more it gets noticed.
The more people who ask this question, the more it gets noticed.
-
Inappropriate?Hi Brian,
I think this might be because comments themselves do not have titles so trying to sort by them will have no effect, you can however, sort the page titles as part of the local-reporter to achieve what you are looking for, here is the markup for the updated expanding-reporter:
-------------------------------
{expanding-reporter:content:all comments|as=comm}
{local-reporter:children} {text-sort:title} {local-reporter}
{date-sort:comm>creation date|order=descending}
{expanding-reporter}
-------------------------------
Let me know if this works for you.
Regards,
Bo Wang
-
This actually raises a question about what {expanding-reporter}'s item value is. I have assumed that it would be a Comment, and I can't find it now but I'm pretty sure that I read that the Content supplier for a Content subtype would actually use the containing page's value for a key that was not applicable to it.
At any rate, I've tried using item > title and comm > page > title as well as actually putting it into the {local-reporter} body, without success.
And then, of course, there's still the fact that {date-sort} also didn't work... -
Yeah, it's not too clear in the documentation. Having just finished wading through it and fixing the main issue, the definitive answer is that with regards to sorting and filtering, {expanding-reporter}'s item is the item being expanded on, not the resulting 'expanded' value. In your case, that would be the Comment.
If you want to sort by Page title, then by comment modification date, do this:
{expanding-reporter:content:all comments|as=comm}
{local-reporter:children}
{text-sort:page:title}
{local-reporter}
{date-sort:comment:creation date|order=descending}
{expanding-reporter}
Hopefully that makes it clearer. We should put some more examples in the official documentation for {expanding-reporter}. -
I certainly agree; I can't tell you how many times I had to read over that example and the Expanded Supplier page before I thought I understood what I needed to do, and I finally just copied it into a page and tried to run it myself, which is when I realized that even the example didn't work.
Also, to clarify (this really should be a separate 'Ask a Question' post, not a comment on this 'Report a Bug' post):
It's clear enough to me (now) that the object available to sorters and filters in any {xxx-reporter} macro body is of the type contained in the Collection to which its key value refers (something you could well add to their documentation so that people don't have to puzzle it out for themselves as I finally did).
I also didn't have too much trouble figuring out that the item key referred to the contained reporter's current enumeration. However, while I assumed that the Expanded Supplier's "as" key (the one named for the as parameter of {expanding-reporter} was also the object available to macros in the report body, I could not get a value if I used a key that assumed that – I had to use the "as" key to get the current item and then refer to its field (yes, this means that – as I have confirmed experimentally – your code above does not work, as comment:creation date is not a key available from the current report item).
It appears, then, that {expanding-reporter) is an exception to my rule above concerning the object types yielded by reporters, because instead it yields an Expanded Supplier object that must be indirected to yield the sub-item from the expansion. -
Yeah, it is an exception. I tossed up whether or not to sort on the 'expanded' object or the original item. Ended up going with the original item because that's what people will always be sorting based on, so why force the extra 'expanded:xxxx'. But yes, it should definitely be documented better - working on that right now. -
Hi Brian. I've updated the documentation here. Could you take a look and let me know if it is sufficient? -
Inappropriate?Hi Brian,
Your problem is probably related to this issue which has been resolved for Reporting 3.2.0, due out very shortly. -
Very shortly indeed...! I see that its release date is today.
Thanks again. -
Yep, should start filtering out via the Plugin Repository soon, if it's not there already. -
Alas... it only works on Confluence 3...
Loading Profile...


EMPLOYEE
EMPLOYEE