Common

In this article we will show how to create a report with the list of pages.

Step 1: Adding Reporting Table View macro to a page

In the following step we will add and configure a Reporting Table View macro. This macro is used as a container for a single reporting data provider and one to many reporting table items. The data is retrieved according to the data provider parameters and then formed to a table according to the Reporting Table Items parameters.

Open the macro browser, locate the Reporting Table View macro and place it to the page.

The faster way is to open the Insert macro menu, enter the beginning of the macro name (all Reporting macro names start with ‘Reporting’) and click on the Reporting Table View macro.

The Reporting Table view macro will appear on the page. You may leave all the parameter values in default state. If you need to show some special text when no items are returned from the data provider, change the Empty response text content parameter value. If you need to show HTML instead of plain text, specify your html in the Empty response text content parameter and change the Empty response text output type parameter value to HTML. We will leave all parameters by default here.

After all parameters are set, close the macro parameters window.

Step 2: Adding Reporting Confluence Data Provider to the Reporting Table View macro body

In the following report we will add and configure the Reporting Confluence Data Provider. Reporting Confluence Data Provider as well as Reporting Jira Data Provider macros read data from the appropriate sources and provide it to the view macro. In this example we will add the Reporting Confluence Data Provider macro for it to read the list of pages from the specified space.

Click on the Reporting Table View macro body to put the focus on it.

Open Insert macro menu, enter “Reporting” and click on Reporting Confluence Data Provider macro.

Ensure that the macro has been added to the Reporting Table View macro body. Otherwise drag and drop it there.

Specify the following parameter values:

  • Query = space=CRD AND type=page
    • This CQL query specifies all the pages of CRD space. “CRD” is a space key.
    • Any other correct CQL query may be specified here.
  • Expand = version,history.lastUpdated,children.page,children.comment
    • This list of expanded fields specifies which parts of data are required.
    • Expand list may be left empty, but not all page info is returned by default.
  • Max results = 7
    • We are making a “Top 7 pages” report here, so we limit the number of pages being returned.
    • Max number cannot be higher than 1000 anyways.

 

Step 3: Adding Reporting Table Item macros to the Reporting Table View macro body

In the following step we will add and then configure the Reporting Table Item macros, which contain all the needed information about the report columns.

Reporting Table Item macro holds the parameters for a single reporting table column. You need to add one Reporting Table Item macro for each column, so for our 5-column report we will add 5 macros.

Click on the Reporting Table View macro body to put the focus on it.

Open the Insert macro menu, enter “Reporting” and click on the Reporting Table Item macro. Do it six (not five!) times. One Reporting Table Item is an extra one, which will help us to configure a report. If the Reporting Table Item macro is added not to the Reporting Table View body, just drag and drop it there.

Note that the order of Reporting Table Item macros makes sense – the columns will be created in the same order.