Tracing Nested References with ServiceRocket Reporting Plugin

Scenario

Given three ServiceRocket Scaffolding templates that form a hierarchy of references (using List Data fields):

  1. Customer
  2. Orders (contains a List Data macro field, and the Key parameter is set to data:Customer, referencing pages made with the Customer template)
  3. Shipment (contains a List Data macro field, and the Key parameter is set to data:Order,  referencing pages made with the Orders template)

This recipe is an example on how to report all shipments associated with a customer.



Recipe

Ingredients

Add-ons

Reporting, Scaffolding

Platform

Level

ADVANCED

Estimated time

30 minutes

Macros

Suppliers

Storage format

Macro structure

You can recreate the example in the editor view:

Steps

  1. Create a Report Block macro. This macro will contain all macros we will create.

  2. Create a Local Reporter macro. Set the following parameters:
    Key: page:children
    Source: "Orders"

  3. Create a Text Filter macro within the Local Reporter we created in the previous step. Set the following parameters as stated:
    Key: data:Customer
    Include: "MyCustomerName"

  4. Within the Report Block macro, but outside the Local Reporter macro, create a Report Body macro and check the Injected parameter to set it to True.

  5. Within the Report Body macro, create a Report List macro, and check the Injected parameter to set it to True.

  6. Within the Report Body macro, create another Local Reporter macro. Set the following parameters as stated: 
    Key: page:children
    Source: "Shipments"

  7. Within the Local Reporter macro created in the previous step, create a Text Filter macro. Set the following parameters as stated:
    Key: data:Order
    Include: %page:title%

  8. Outside the Local Reporter macro (created in step 7), create another Report Body macro.

  9. Within the Report Body macro, create Report Info macro and set the Key to page:title.

  10. Outside the Report Body macro (created in step 6), create a Report List macro .