List of accounts

Add the following macro to the template if you want to see the balance of each variable split into balances of individual accounts. This means that for each variable in your report, you will see the list of accounts that this variable consists of. You must add this macro to the very beginning of your template, before the rest of the code. In most of the cases, it is enough to copy and paste the whole macro. However, if your template has uncommon layout (for example, contains additional columns), you will have to edit the macro’s content to display the record structure appropriately.

Afterwards, you must call this macro for every variable for which you would like the list of accounts to be displayed. Remember that you should use this macro for low-level variables only, and not for the total variables (variables containing other variables).


If you want to use the list of accounts in your report, adding this macro to the template is only the first step. We also recommend to add the List of Accounts optional filter to your report. With this filter, the Show individual accounts box will be available in your report’s header (enabling you to display or hide individual accounts). To learn more about adding report filters, see Filters.

In the following example, you can see a macro (printFullVariable) and a sample report. In this report, the macro is called for var_AI1, var_AI2, and var_AI3 variables:

          <!-- Paste this macro before at the beginning of your template -->
    <#macro printFullVariable name value value2=0 accounts=[] level=1>
        <tr class="csr-level-${level}">
            <td class="csr-label">${name}</td>
            <td class="csr-value"><#if !accounts?has_content>${value}</#if></td>
            <td class="csr-value csr-secondary"><#if !accounts?has_content>${value2}</#if></td>
        <#list accounts as acc>
            <tr class="csr-level-${level + 1}">
                <td class="csr-label"><#if acc.number?length gt 0 >${acc.number} - </#if>${}</td>
                <td class="csr-value">${acc.value}</td>
                <td class="csr-value csr-secondary">${acc.value2}</td>
        <#if accounts?has_content>
            <tr class="csr-level-${level} csr-total">
                <td class="csr-label">Total - ${name}</td>
                <td class="csr-value">${value}</td>
                <td class="csr-value csr-secondary">${value2}</td>
<!-- END of macro -->
<table class="csr-about">
    <!-- ... -->
<div class="csr-content">
    <table class="csr-data csr-indent-deep">
                <td width="80%">${}</td>
                <td width="20%" class="csr-align-right">${}</td>
            <!-- Section A -->
            <tr class="csr-level-1">
                <td class="csr-label">${}</td>
            <!-- Subsection A I. -->
            <tr class="csr-level-2">
                <td class="csr-label">${}</td>
            <!-- To render the lowest-level variable with the list of included accounts, call the macro -->
            <!-- The first arguments are attributes of the variable and the last one is the indentation level to be printed -->
            <@printFullVariable VAR.var_AI1.value VAR.var_AI1.value2 VAR.var_AI1.accounts 3 />
            <@printFullVariable VAR.var_AI2.value VAR.var_AI2.value2 VAR.var_AI2.accounts 3 />
            <tr class="csr-level-4">
                <td class="csr-label">${}</td>
                <td class="csr-value">${VAR.var_AI2_of.value}</td>
            <@printFullVariable VAR.var_AI3.value VAR.var_AI3.value2 VAR.var_AI3.accounts 3 />
            <!-- Total for subsection A I. -->
            <tr class="csr-level-2 csr-total">
                <td class="csr-label">${}</td>
                <td class="csr-value">${VAR.var_AI_total.value}</td>
            <!-- END Subsection A I. -->
            <!-- Subsection A II. -->
            <tr class="csr-level-2">
                <td class="csr-label">${}</td>
                <td class="csr-value">${VAR.var_AII.value}</td>
            <!-- END Subsection A II. -->
            <!-- Total for section A -->
            <tr class="csr-level-1 csr-total">
                <td class="csr-label">${}</td>
                <td class="csr-value">${VAR.var_A_total.value}</td>
            <!-- END Section A -->
        <!-- Total all -->
        <tfoot class="csr-totalall">
                <td width="80%" class="csr-label">${}</td>
                <td width="20%" class="csr-value">${VAR.total_all.value}</td>
        <!-- END Total all -->

An example of how a table created using the Country-Specific Reports SuiteApp looks like with the List of Accounts feature on. The balances of each individual accounts are displayed for each variable in the table.

Related Topics

Creating a Template for the Country-Specific Reports SuiteApp
Sample table
Subtotals and totals
Indentation levels
Comparative column
Two-columns layout
Custom alignment
About sections

General Notices