Displaying reported data in a table row, linked to a page defined in that row?
I'd like to build a table using scaffolding where the first column is a page title. The remaining columns should show metadata or scaffolding data (whichever works!) from that page.
Is this possible, and how?
Bryan
Is this possible, and how?
Bryan
3
people have 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.
The best answer from the company
-
Hi Bryan,
You can't do it currently with {report-info} (or any reporting macro), but it will be supported in the next version of Scaffolding+Reporting.
In the meantime, you can use {get-data}, something like this:
{table-data:UserStories}
|| Story ID || Title || Story Points ||
| {text-data:StoryID}{text-data} | [Link|{get-data:StoryID}] | Story Points |
{table-data}
The company and 1 other person say
this answers the question
-
Inappropriate?Trying this as a basic test doesn't work:
{table-data:UserStories}
|| Story ID || Title || Story Points ||
| {text-data:StoryID}{text-data} | {report-block}{local-reporter:@self}{local-reporter}{report-body}{report-info:data:StoryID}{report-body}{report-block}
| Story Points |
{table-data}
There is another page in the Space with the page name "US-xxx". The idea is to put US-xxx in the first column and then show data from that page (Title and Story Points) in the second and third columns.
Bryan
I’m frustrated
-
Inappropriate?Hello,
you could use something like this:
{report-table}
{local-reporter:page:children | source=define-location-here}
{text-sort:content:title}
{local-reporter}
{report-column:title=Your-column-name-here}{report-info:content:title|link=true}{report-column}
{report-table}
Please note, this example is for parent-children page structure. I have no idea where US-xxx is placed. -
Inappropriate?The page could be anywhere in the space.
The page title is defined in the same row of the table. So column 1 defines the page title, and column 2 shows data from the page. How do I get the value from another column in the same row of the scaffolding table? I can get data in page scope, but don't know how to get data in row scope.
I’m frustrated
-
Inappropriate?Hi Bryan,
You can't do it currently with {report-info} (or any reporting macro), but it will be supported in the next version of Scaffolding+Reporting.
In the meantime, you can use {get-data}, something like this:
{table-data:UserStories}
|| Story ID || Title || Story Points ||
| {text-data:StoryID}{text-data} | [Link|{get-data:StoryID}] | Story Points |
{table-data}
The company and 1 other person say
this answers the question
-
see below for the final solution based around this technique -
Inappropriate?I have the same question - but instead of the page I want to display an image.
{table-data:Photos|initialRows=3}
|| Picture || Comment || Date ||
| {attachment-data:Image|include=.*gif,.*jpg,.*png} (report-info on Image should be here) | {text-data:Comment}{text-data} | {date-data:Date|format=dd. MMM yyyy}{date-data} |
{table-data}
I'm afraid that this can't be accomplished with {get-data}.
I’m anxious
-
Inappropriate?I think you should be able to do that one too, since you can do it with !...! markup. Eg:
!^{get-data:Image}!
The main place {get-data} doesn't work is when you want to put it inside another macro. That's where the next update of Scaffolding/Reporting will save your bacon... -
Inappropriate?Thank's a lot for your answer!
Unfortunately this is my result:

Am I wrong with my code?
{table-data:Photos|initialRows=3}
|| Picture || Comment || Date ||
| {attachment-data:Image|include=.*gif,.*jpg,.*png} !^{get-data:Image}! | {text-data:Comment}{text-data} | {date-data:Date|format=dd. MMM yyyy}{date-data} |
{table-data}
I promise, blume2.jpg and lilie.jpg are attached to the page.
I’m hopeful
-
Inappropriate?Hmm. I think that {get-data} must be rendering it as a hyperlink rather than just outputting the name of the file. Not sure if there's a good way around that currently.
-
The first file name is generated by {attachment-data}, {get-data} will produce the error.
Ok, so I'll wait for the next plugin version to solve it with {report-image}. Do you have an idea when the version will be released? -
Inappropriate?So how would I structure it to get back a scaffolding or metadata field from the page, instead of just a link to it? Is that not possible at all without the new version? And when would the new version be available?
Is there a workaround by having a hidden table with the raw list in it, and then a report running against that (so not using "current row" scope)?
Bryan
I’m undecided
-
Inappropriate?For your example Bryan it will still work fine. The problem is with values stored using {content-options}, which are actually references to the actual page object. As such, {get-data} renders them as links. But when it's referring to a {text-data} field it should still work just fine as per my example above.
-
Inappropriate?What would the {get-data} syntax be to get a data field called StoryPoints from a page defined by StoryID field as above?
-
Inappropriate?Eh...that gets trickier. For that kind of activity you will either need to wait for the next version of Reporting or use Adaptavist's 'Replace and Render Plugin'. Either way, it gets a little convoluted...
-
Inappropriate?Do you happen to know how to get replace-and-render (or an equivalent) in Confluence v3.0.0_01? It claims not to be supported about Confluence 2.10, and it doesn't appear in the plugin repository.
-
Inappropriate?Hmm. I was assuming it would be enabled. My guess is that it will basically work in 3.0, but will probably have similar issues to the problem we have with Reporting, where the change in Confluence's renderer will force it to add extra paragraph breaks around the macro. This may not be a real issue with your example if it was going to be in its own paragraph anyway.
-
Inappropriate?In Katharina's image example above, is it possible to resolve this problem by showing the table-data only in edit mode and then show a report-table in view mode that is built by reading from the table-data data? If so, how can this be done? Thanks!
-
Inappropriate?I figured out how to do this. Here's the wiki code, hope this helps someone...
{show-if:action=edit}
{table-data:ImageTable}
|| File || Comment ||
| {attachment-data:image} | {text-data:comment} |
{table-data}
{show-if}
{show-if:action=view}
{report-table}
{local-reporter:data:ImageTable}
{report-column:title=Image}
{replace-and-render}
{replace-item:%something%}{report-info:data:image}
{replace-item}
{replace-body}!%something%!
{replace-body}
{replace-and-render}
{report-column}
{report-column:title=Comment}{report-info:data:comment}{report-column}
{report-table}
{show-if}
1 person says
this answers the question
-
Just FYI, if you're doing it this way, you can just use injection directly - no need for Replace and Render here. It would look something like this:
{report-table}
{local-reporter:data:ImageTable}
{report-column:title=Image|injected=true}!%data:image%!{report-column}
{report-column:title=Comment}{report-info:data:comment}{report-column}
{report-table} -
Also, you might want to use {hide-if:action=edit} instead around the {report-table}, otherwise it may hide the table in more places than you intend, such as the printable view or PDF exports. -
Inappropriate?Is there a way to make replace and render work in Confluence 3.0? It's failing to install.
I’m frustrated
-
Adaptavist is responsible for Replace and Render, so they would probably have a better idea. I'm assuming you've tried downloading it manually and installing via Admin > Plugins? -
Inappropriate?Yes - if it works, the macro browser breaks :(
-
Inappropriate?Unfortunately I can't use show-if as the Visibility plugin crashes with a null exception on installation :( - Is there another plugin that does something similar? I'm so close! I have two tables as above, and it's working - I just need to hide one and show the other.
I’m frustrated
-
I'm not aware of any issues with the Visibility plugin that cause a NullPointerException. Could you please try to track down the full error trace for the exception and post it in a bug report and we'll try to sort it out from there. -
Logged as VISIB-67 -
Inappropriate?It's not so glorious like the solution with {show-if}, but maybe for the first time (since the NPE bug is fixed?) better than nothing: I hide the "input table" with {hidden-data}. Because the CustomWare page is down at the moment and I can't download the .jar or use the plugin browser (because visibility plugin doesn't appear???).
I’m sad
-
Inappropriate?David,
Originally I tried your suggestion with !%data:image%! however I was getting a strange number returned from %data:image%
Based on something I read in another post yesterday, I just figured out that you can do this to get it to work...
!%data:image > reference:value > attachment:file name%!
Like so...
{report-table}
{local-reporter:data:ImageTable}
{report-column:title=Image|injected=true}!%data:image > reference:value > attachment:file name%!{report-column}
{report-column:title=Comment}{report-info:data:comment}{report-column}
{report-table}
Thanks! -
Inappropriate?For others googling this, here's one way to solve the problem, taking inspiration from everyone above:
{show-if:action=edit}
{table-data:UserStories}
|| Story ID ||
| {text-data:StoryID}{text-data} |
{table-data}
{show-if}
{hide-if:action=edit}
{report-table}
{local-reporter:data:UserStories}
{report-column:title=Page}{report-link:data:StoryID}{report-info:data:StoryID}{report-link}{report-column}
{report-column:title=Story}{replace-and-render}{replace-item:%ID%}{report-info:data:StoryID}{replace-item}{replace-body}{metadata-from:%ID%|Story}{replace-body}{replace-and-render}{report-link}{report-column}
{report-column:title=Points}{replace-and-render}{replace-item:%ID%}{report-info:data:StoryID}{replace-item}{replace-body}{metadata-from:%ID%|Story Points}{replace-body}{replace-and-render}{report-link}{report-link}{report-column}
{report-table}
{hide-if}
I’m getting there...
-
see below for a better solution -
Inappropriate?Bryan, try installing Theme Builder and using the builder-hide or builder-show macros. You can achieve the same thing as show-if, hide-if.
-
ooh... -
no need - see below -
Inappropriate?Just to clarify, my last suggestion was in response to anyone who cannot currently install the Visibility plugin. Otherwise show-if and hide-if will work fine.
-
Inappropriate?And a neater solution, which is where I had wanted to be originally (and removes the need for hide/show):
{table-data:UserStories}
|| ID || Link || Story || Points ||
| {text-data:StoryID}{text-data} |
{replace-and-render}{replace-item:%ID%}{get-data:StoryID}{replace-item}{replace-body}[Link|%ID%]{replace-body}{replace-and-render} |
{replace-and-render}{replace-item:%ID%}{get-data:StoryID}{replace-item}{replace-body}{metadata-from:%ID%|Story}{replace-body}{replace-and-render} |
{replace-and-render}{replace-item:%ID%}{get-data:StoryID}{replace-item}{replace-body}{metadata-from:%ID%|Story Points}{replace-body}{replace-and-render} |
{table-data}
Unfortunately you can't put a | character in the render-body, so it has to be three separate replace-and-render blocks, one in each table cell.
I’m done!!!
-
Why you don't use injected=true? Do you really need this ugly {replace-and-render} macros? -
How would you use injected to do this? Could you show me an example of one of these columns done like that? -
Ok, you're right :) I didn't managed to solve it with injected=true. -
phew - it wasn't just my newbie-ness then! -
Inappropriate?Wow, I've really got to get the next version out and put a stop to all this crazy hackery :)
Loading Profile...



EMPLOYEE
