Get your own customer support community
 

How can I use the grouping reporter to create totals from multiple tables?

I have multiple simple tables (one per page) via table-data, each with a name and value column. I want to create a sum of all the values for each name.

I've used the expanding-reporter to provide one table of every value, but using grouping-reporter doesn't seem to do the trick .. am I on the right track?

the table-data on each "result" page is as follows:

--------------
{table-data:results}
| {text-data:player}{text-data} | {number-data:place}{number-data}| {number-data:winnings}{number-data} |
{table-data}
--------------

So far, I tried this as an intermediate step, which gives me repeated players and their winnings from each result page:

--------------------------
{report-table}
{expanding-reporter:data:results|as=expandedresults}
{content-reporter:labels=result}{content-reporter}
{expanding-reporter}
{report-column:title=Player}{report-info:expandedresults > player}{report-column}
{report-column:title=Player}{report-info:expandedresults > winnings}{report-column}
{report-empty}{report-empty}
{report-table}
--------------------------

when I surround the "expanding-reporter" with a grouping reporter, I see a few things ...

1) each individual table is grouped, not the whole thing.
2) I can access "winnings" as the key, but I can't use "player"

More information:

the following correctly prints out each player name:

---------------
{expanding-reporter:data:results|as=eresults}
{content-reporter:labels=result}{content-reporter}
{expanding-reporter}

{report-body}
{report-info:expanded:eresults > map:player}
{report-body}

{report-empty}nada{report-empty}
{report-block}
----------------------

But then the following bombs:

------------
{report-block}
{grouping-reporter:expanded:eresults > map:player|as=gplayer}
{expanding-reporter:data:results|as=eresults}
{content-reporter:labels=result}{content-reporter}
{expanding-reporter}
{grouping-reporter}
{report-body}
{report-info:grouped:gplayer}
{report-body}
{report-empty}nada{report-empty}
{report-block}
------------

with the following error:

Error formatting macro: report-block: java.util.NoSuchElementException
This is not currently in the context of a report.
 
sad I’m a newbie
Inappropriate?
1 person has this question

User_default_medium