---
title: "Document Stats Report macro"
canonical: "https://support.appfire.com/space/COMALACDCLS/650122169/Document%20Stats%20Report%20macro"
format: markdown
---
> Macro (aura-html)

> Macro (excerpt)
> 
> Displays on a page the count for content in each workflow state

## Overview

The **Document Stats Report macro** is used to display a count of the content currently in each workflow state.

![image](media://36596667-3b47-42cb-ae0f-620d72413930)

This workflow information in the reporting columns, by default, includes all the workflow states in the current space (except for the space homepage).

One or more filters can be added to the **document-stats-report** **macro**, for example, to filter the display to specific states or the states in one or more workflows.

Once added to a page, the report macro dynamically updates the count of the states.

## Permissions

Anyone can see this report.

- View-only users only see results for content that has reached a Published (** **`final=true`** **) state, even if there are subsequent draft state edits to that content
- Documents that have not yet been published or documents with an applied workflow that does not define a published state, are not shown

## Adding the report

To add the report to a page, choose the **Document Stats Report** macro.

On a draft page, either

- Choose **Insert   **> Macro (inline-media-image)

** → Other Macros → Reporting → Document Stats Report**
- Or type **{doc stats ...**  on the page
- Select** Document Stats Report **(or open the macro browser to search)

![image](media://cc37d83d-d1b9-4df4-a2f7-25428e6709f3)

- Select the macro
- Choose** Edit**

![image](media://a4ec97c7-20ef-4518-a851-1b1a5a9bc427)

- choose report filters and display column settings

![cdcdc_documentstatsreportmacro_editor.png](media://48267791-3178-4150-8bba-869ae90f7e35)

- Scroll down the macro editor to add or edit report filter options

> ℹ️ By default, the report displays a count for all workflow states, including those where no document with an applied workflow is currently in the state

- Choose **Save** to update the macro on the draft page
- Choose **Update** to add the report to the page

Here's how the report looks on your page.

![image](media://07529fc4-fd22-4269-bfc6-4894ec25a4fc)

## Customizing the report

Edit the **Document Stats report** macro to customize the report by

You can choose to filter the state count for the content by

- label(s)
- parent
- space(s) using the space key

If multiple labels are added, the report displays the state information for documents with each label. If you want to display information for documents that must have all the specified labels, add the **&** (and ampersand) operator in front of the first label in the list

The macro can also be customized for

- One or more states
- One or workflows

> ℹ️ The order of the column displayed on the page is defined by the order of entry of the state name column in the macro editor.

## Filter the report

In the macro editor, select options to filter the report. These include options to filter by state, workflow, space key, label, and parent page(see table below).

> 📝 If a workflow has been removed from content that is in the scope of the report macro, but the history has been retained, the report will show the last state information for the content.

The filters are listed alphabetically in the macro editor.

| Setting | Default | Notes |  |
| --- | --- | --- | --- |
| **Label** | *blank* | Should the report be filtered by content label(s)?<br>- leave empty to include all content
- list one label name to filter to a specific label
- list multiple label names, separated by commas, to filter to content with any of those labels<br>If using a list of labels, you can prefix the list with the   **& **  (ampersand) to require that the content has all the labels. O*therwise, it reports on pages containing any of the listed labels.* |  |
| **Parent page** | *blank* | Report limited to child pages of the specified page.<br>- Leave empty to include all content in the current space (does not include the home page as this is the default parent)
- Specify a page title to include only its child pages
- Use **@self** to specify child pages of the current page |  |
| **Ancestor page** | blank | The report is limited to the descendant pages of the specified page.<br>- Use **@self** to report on the descendant pages of the current page
- Specify a page title to include only its descendant pages<br>> 📝 If specifying an ancestor page, you cannot list multiple space keys. The report defaults to the descendant pages of the added page. | v2.4.0+ [DATA CENTER] |
| **Spaces** | *blank* | Which space should be included in the report?<br>- Accepts one or more space keys
- Leave empty to include all content in the current space (does not include the current space home page as this is the default parent)<br>> 📝 If a parent page is added, you cannot specify more than one space. |  |
| **State(s)** | *blank* | The count for all the states in the scope of the macro editor settings is displayed.<br>- Leave empty to include all content in all states
- Limit report by listing one or more state names in a comma-separated list<br>The report includes the state count for content where the workflow has been removed, but the workflow history has been retained |  |
| **Workflow** | *blank* | A comma-separated list of workflows to be displayed.<br>- Leave empty to include all content in all states in all workflows
- Limit report by listing one or more workflow titles in a comma-separated list<br>If left empty, then the report includes the state count for content where the workflow has been removed but the workflow history has been retained |  |

## Use with Confluence chart macro

The document stats report macro can be added to the Confluence chart macro to display the report information.

![image](media://31aad39b-5944-40a7-a195-9a602346df47)

The Confluence chart macro display is based on the [document-stats-report](https://appfire.atlassian.net/wiki/spaces/AWPD/pages/617490270) macro filters.

![image](media://a2715de5-7a97-4c4c-a580-ce8ab764625c)

## Related pages

- [https://appfire.atlassian.net/wiki/spaces/COMALACDCLS/pages/650122298](https://appfire.atlassian.net/wiki/spaces/COMALACDCLS/pages/650122298)