Multiple Ways to Use Expanding Reporter
Scenario
This recipe is relevant for page structures with a Parent page to Children page to Descendant:
In each sub-child page, a table can be wrapped inside Scaffolding's Table Data macro.
For example:
Inside the table, configure the Text Data macro to get user input.
This recipe explains how to pull text from the nested Text Data macro and display it as a report on a different page.
Result
Recipe
Apps | Reporting for Confluence Server & Data Center, Scaffolding |
---|---|
Level | Intermediate |
Estimated time | 20 minutes |
Macros | Content Reporter, Expanding Reporter, Local Reporter, Report Body, Report Column, Report Info, Report Table, Text Filter |
Suppliers | Expanded Supplier, Report Supplier |
Storage format
You can copy and paste this code into the Confluence Source Editor:
<p>
<span style="font-size: 16.0px;font-weight: bold;">Method 1 :</span>
</p>
<ul>
<li>Expanding Reporter - Content Reporter > Labels</li>
</ul>
<ac:structured-macro ac:macro-id="f1735f6a-5a2b-4e69-bb06-cffa1550fda0" ac:name="report-table" ac:schema-version="1">
<ac:rich-text-body>
<p class="auto-cursor-target">
<br/>
</p>
<ac:structured-macro ac:macro-id="ffeb0caf-dc84-4358-a6ba-7a84918728f5" ac:name="expanding-reporter" ac:schema-version="1">
<ac:parameter ac:name="as">mytable</ac:parameter>
<ac:parameter ac:name="">data:mytable</ac:parameter>
<ac:rich-text-body>
<p class="auto-cursor-target">
<br/>
</p>
<ac:structured-macro ac:macro-id="4bb2cb25-775b-44d2-a313-0dcae7188682" ac:name="content-reporter" ac:schema-version="1">
<ac:parameter ac:name="labels">customer, reviews</ac:parameter>
<ac:rich-text-body>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p class="auto-cursor-target">
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p class="auto-cursor-target">
<br/>
</p>
<ac:structured-macro ac:macro-id="bec5d3cd-54b5-4810-bb23-06c10ae5ee7b" ac:name="report-column" ac:schema-version="1">
<ac:parameter ac:name="title">ID</ac:parameter>
<ac:rich-text-body>
<p>
<ac:structured-macro ac:macro-id="94be49d0-e13e-48c7-b2b2-bf324d028953" ac:name="report-info" ac:schema-version="1">
<ac:parameter ac:name="">expanded:mytable > data:myid</ac:parameter>
</ac:structured-macro>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p class="auto-cursor-target">
<br/>
</p>
<ac:structured-macro ac:macro-id="ec9653b6-f4bf-4199-b95f-917fea36b23a" ac:name="report-column" ac:schema-version="1">
<ac:parameter ac:name="title">Content</ac:parameter>
<ac:rich-text-body>
<p>
<ac:structured-macro ac:macro-id="45a3af51-ca1d-49c2-ad50-9120effc4ac9" ac:name="report-info" ac:schema-version="1">
<ac:parameter ac:name="">expanded:mytable > data:mycontent</ac:parameter>
</ac:structured-macro>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p class="auto-cursor-target">
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p>
<br/>
</p>
<hr/>
<h3>Method 2:</h3>
<ul>
<li>Expanding Reporter - Content Reporter - Text Filter > %content:title%</li>
</ul>
<ac:structured-macro ac:macro-id="c8faa196-4c20-431c-a3ac-551c2757eb40" ac:name="report-table" ac:schema-version="1">
<ac:parameter ac:name="injected">true</ac:parameter>
<ac:rich-text-body>
<p class="auto-cursor-target">
<br/>
</p>
<ac:structured-macro ac:macro-id="d3d4bac1-39e8-4c34-89d9-b9db15d3fb80" ac:name="expanding-reporter" ac:schema-version="1">
<ac:parameter ac:name="as">mytable</ac:parameter>
<ac:parameter ac:name="">data:mytable</ac:parameter>
<ac:rich-text-body>
<p class="auto-cursor-target">
<br/>
</p>
<ac:structured-macro ac:macro-id="4e58687c-5d9d-4e5b-8bff-d18de90031ed" ac:name="content-reporter" ac:schema-version="1">
<ac:rich-text-body>
<p>
<ac:structured-macro ac:macro-id="e2026e1e-cbea-462c-889d-c26b1be96ded" ac:name="text-filter" ac:schema-version="1">
<ac:parameter ac:name="include">.*RockettoriaCafe.*</ac:parameter>
<ac:parameter ac:name="">content:title</ac:parameter>
</ac:structured-macro>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p class="auto-cursor-target">
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p class="auto-cursor-target">
<br/>
</p>
<ac:structured-macro ac:macro-id="24d0681e-0aef-4dff-ae27-a361c052fd27" ac:name="report-column" ac:schema-version="1">
<ac:parameter ac:name="title">ID</ac:parameter>
<ac:rich-text-body>
<p>
<ac:structured-macro ac:macro-id="71bbeb6c-fcae-49c6-b8d8-a3b9ba4d4820" ac:name="report-info" ac:schema-version="1">
<ac:parameter ac:name="">expanded:mytable > data:myid</ac:parameter>
</ac:structured-macro>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p class="auto-cursor-target">
<br/>
</p>
<ac:structured-macro ac:macro-id="70e70a4c-9859-4448-84d1-3620c3749778" ac:name="report-column" ac:schema-version="1">
<ac:parameter ac:name="title">Content</ac:parameter>
<ac:rich-text-body>
<p>
<ac:structured-macro ac:macro-id="27e04ccb-8cec-4af0-bf2d-8d7c4db257b8" ac:name="report-info" ac:schema-version="1">
<ac:parameter ac:name="">expanded:mytable > data:mycontent</ac:parameter>
</ac:structured-macro>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p class="auto-cursor-target">
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p>
<br/>
</p>
<hr/>
<h3>Method 3:</h3>
<ul>
<li>Expanding Reporter - Content Reporter > Scope</li>
</ul>
<ac:structured-macro ac:macro-id="e6966311-6455-4e9b-8d85-2ee616430c49" ac:name="report-table" ac:schema-version="1">
<ac:rich-text-body>
<p class="auto-cursor-target">
<br/>
</p>
<ac:structured-macro ac:macro-id="9eb9229c-b927-4485-b229-d18affade94e" ac:name="expanding-reporter" ac:schema-version="1">
<ac:parameter ac:name="as">mytable</ac:parameter>
<ac:parameter ac:name="">data:mytable</ac:parameter>
<ac:rich-text-body>
<p class="auto-cursor-target">
<br/>
</p>
<ac:structured-macro ac:macro-id="437ac07f-eb07-496c-a2e9-08b1efb10858" ac:name="content-reporter" ac:schema-version="1">
<ac:parameter ac:name="scope">Report on Rocketoria Cafe from Child Pages > children</ac:parameter>
<ac:rich-text-body>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p class="auto-cursor-target">
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p class="auto-cursor-target">
<br/>
</p>
<ac:structured-macro ac:macro-id="c2d3d124-7268-470b-afcc-f9c905675eba" ac:name="report-column" ac:schema-version="1">
<ac:parameter ac:name="title">ID</ac:parameter>
<ac:rich-text-body>
<p>
<ac:structured-macro ac:macro-id="fb2b8192-1888-4644-8db0-1666099d9aca" ac:name="report-info" ac:schema-version="1">
<ac:parameter ac:name="">expanded:mytable > data:myid</ac:parameter>
</ac:structured-macro>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p class="auto-cursor-target">
<br/>
</p>
<ac:structured-macro ac:macro-id="9d67ebcd-01db-4169-8faa-be1938ce7400" ac:name="report-column" ac:schema-version="1">
<ac:parameter ac:name="title">Content</ac:parameter>
<ac:rich-text-body>
<p>
<ac:structured-macro ac:macro-id="65537f26-5272-4934-a179-b88f3510ff49" ac:name="report-info" ac:schema-version="1">
<ac:parameter ac:name="">expanded:mytable > data:mycontent</ac:parameter>
</ac:structured-macro>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p class="auto-cursor-target">
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p class="auto-cursor-target">
<br/>
</p>
Macro structure
You can recreate the example in the editor view:
Steps
For the first method the report will be generated based on the page filter:
Create Report Table macro.
Within the Report Table macro, create Expanding Reporter macro. Set the following parameters:
Key:Âdata:mytable
As:Â "mytable"Within the Expanding Reporter macro, create Content Reporter macro. Set Labels to "customer" (a label assigned to any of the created sub-pages).
Within the Report Table macro, create Report Column. Set Title to "ID".
Within the Report Column macro, create Report Info macro. Set Key toÂ
expanded:mytable > data:myid.
Within the Report Table macro, create Report Column. Set Title to "Content".
Â
For the second method the report will be generated based on page title:
Create Report Table macro.
Within the Report Table macro, create Expanding Reporter macro. Set the following parameters:
Key:data:mytable
As:Â "mytable"Within the Expanding Reporter macro, create Content Reporter macro.
Within the Report Table macro, create Text Filter macro. Set the following parameters:
Key:content:title
Include: ".*RockettoriaCafe.*"Within the Report Table macro, create Report Column. Set Title to "ID".
Within the Report Table macro, create Report Column. Set Title to "Content".
For the second method the report will be generated based on Scope:
Create Report Table macro.
Within the Report Table macro, create Expanding Reporter macro. Set the following parameters
Key:data:mytable
As:Â "mytable"Within the Expanding Reporter macro, create Content Reporter macro. Set Scope to "Report on Rockettoria Cafe from Child Pages > children"
Within the Report Table macro, create Report Column. Set Title to "ID".
Within the Report Table macro, create Report Column. Set Title to "Content".