{expand-on}
Plugin: Reporting Plugin, from version 1.0 until version 3.0.0
This macro will tell the reporter to expand its list of items to include an item for each value in a sub-item, specified by the 'prefix:key' value.
Description
 | Please Note! As of Reporting 3.0.0, this macro no longer exists. Please update your reports to use the expanding-reporter instead. An example of converting your reports is on that page. |
In database query terms, this is essentially a 'join' operation, and is mostly useful for many-to-many relationships.
For example, a user can be a member of many groups, and each group can have many users as members. If you wish to display a list of all groups and their members in a single table, with only one group and one user listed per row, you need to expand on one or the other. You will end up with both being repeated multiple times, but such is the nature of the relationship. Have a look at the examples below for more details.
Usage
Parameters
| Name |
Required |
Default |
Description |
| [default]/key | | | The key value to expand on. |
| as | | | The name to set each expanded item as when accessing it in the report. May not be 'item', as this is reserved for the original item being expanded. |
| matchAll | | true | If set to 'false', content matching any of the criteria will be returned. Otherwise, the content must match all criteria. |
Examples
Display a user/group table
Using the user-group-reporter it would look something like this:
You would then display your results by doing something like this (inside a report-table of course):
Note the use of 'expanded:item' and 'expanded:member'. 'expanded:item' always refers to the original item being expanded on, in this case the user group. 'expanded:member' is used because the original {expand-on} macro declared that each of the items in 'user-group:members' would be known as 'member'.
Note also that you can specify sort order inside the {expand-on} macro. You can also add any filters you wish to, and they will only apply to the items being expanded on.
See Also
Hi,
Is there a way to make "inclusive joins" rather than exclusive joins?
For example, I'd like to expand on all available images attached to the each page being reported... But if there is no image, I'd like the page to be included in the report nonetheless...
Thanks a lot for your help,
Vincent
The point of expand-on is that you are basically iterating through the available options. It might be possible to add an option to allow the parent item even if no expanded items are available. Create a feature request with an example of where you would use this and we'll consider it.
Hi,
i have some problems to get your examples to work (or is this macro deprecated ?)
e.g.
the above example doesn't work (yes, i have admin rights)
{report-table} {user-group-reporter} {text-sort:user-group:name} {expand-on:user-group:members|as=member} {text-sort:user:name} {expand-on} {user-group-reporter} {report-column:title=Group Name}{report-info:expanded:item > name}{report-column} {report-column:title=Username}{report-info:expanded:member > name}{report-column} {report-column:title=Email}{report-info:expanded:member > email|link=true}{report-column} {report-table}It shows me
text-sort: This macro must be used in a sortable location, such as a reporter macro.
expand-on: The current context is not expandable.
text-sort: This macro must be used in a sortable location, such as a reporter macro.
and the examples in the recipe list don't work too.
Using reporting-plugin 2.1.1 and Confluence 2.72
Looks like the default user-group-reporter is failing. Could you create a bug report, and if possible find the full exception stack trace for the failure, which will be in your web server's log file.
Sure ...
done !
I just noticed that you should remove the {text-sort:content:title} line out of your "External Link List Recipe" otherwise you'll get this error.
Error formatting macro: report-table: net.customware.confluence.reporting.supplier.SupplierValueException: Error while comparing 'content:title': null
This is not currently in the context of a report.
This is not currently in the context of a report.
This is not currently in the context of a report.
This is not currently in the context of a report.
Maybe it's another bug