I've seen recipes that leverage the Scaffolding plugin to combine tables from child pages onto a parent page with a {report-table} . I'd like to share a way to accomplish something similar without using the Scaffolding plugin.
{report-table}
{expanding-reporter:content:body > text:find ([^\\\\u007c]+)\\\\u007c([^\\\\u007c]+)\\\\u007c([^\\\\u007c]+)\\\\u007c([^\\\\u007c]+)\\\\u007c([^\\\\u007c]+)\\\\u007c([^\\\\u007c]+)\\\\u007c[\\\\r\\\\n](\\?\\=[\\\\s\\\\S]*Next.Section)|as=foo}
{local-reporter:content:children}
{local-reporter}
{expanding-reporter}
{report-column:title=First Column|width=10em}{report-info:expanded:foo > match:group 1|render=wiki}{report-column}
{report-column:title=Second Column|width=10em}{report-info:expanded:foo > match:group 2|render=wiki}{report-column}
{report-column:title=Third Column|width=10em}{report-info:expanded:foo > match:group 3|render=wiki}{report-column}
{report-column:title=Fourth Column|width=10em}{report-info:expanded:foo > match:group 4|render=wiki}{report-column}
{report-column:title=Sixth Colum|width=10em}{report-info:expanded:foo > match:group 5|render=wiki}{report-column}
{report-column:title=Seventh Column|width=10em}{report-info:expanded:foo > match:group 6|render=wiki}{report-column}
{report-column:title=Eight Column|width=10em}{report-info:expanded:item > content:title > text:match (Report - YYYYMMDD - )(.*) > match:group 2}{report-column}
{report-table}
Some notes about this:
- \\\\u007c is how one puts a pipe '|' in the regex. One has to use the hex value and then triply escape it. Confluence tables use a lot of pipes, so this part is important.
- The regex is basically looking for lines with pipes in them and pulling out strings between the pipes into regex groups.
- The expanding reporter leverages 'text:find' to create the return list that this reporter requires.
- The parens in the regex pass regex groups down through the {report-info} which can then be accessed with the 'match:group'. Recall that the expanding reporter is a wrapper for the report-info.
- 'render=wiki' will keep unwanted bits in the markup from appearing.
- This regex uses a positive lookahead to make sure it's pulling from the correct table. A negative lookahead may also be used in case the child page has many tables.
If folks have any interest or questions, I can post more of an explanation. But I think for most folks familiar with the Reporting plugin will find this helpful.