List Processing (Part 8) – More Samples

A Basic Reporting Table

A reporting table takes data of this format:

The rounded corner boxes are Hashes.

46

Worked Example 1

LET $data := DB_LOOKUPALL(ARRAY("username", "DisplayName"), "sys.Users");

45

This is conveniently formatted already in the correct format for the “rows” value of a ReportingTable.

RETURN HASH(
    "columns", ARRAY(
        HASH(
            "heading", "username",
            "width", 100,
        ),
        HASH(
            "heading", "username",
            "width", 100,
        )
    ),
    "rows", $data
)

This is the exact data/structure described above:

44

Related Articles