In this article
1: Overview
The Toolbar Widget allows you to add a Custom tile and/or a Selector to the filter bar area of a report.
A custom tile allows for continuous viewing of report level information. With a Selector, the toolbar widget lets end users adjust the report in various ways, such as changing hierarchy roll-up, showing or hiding widgets on the page, and altering styles/themes, among other functions.
Example of a Toolbar Widget
2: Setting up the Toolbar Widget
The Toolbar Widget goes in the “layoutArea toolbar” section in CDL.
Example
View CDL
widget toolbarWidget {
tile custom {
expression #first {
value: @examplevalue
formatter: bigNumberFormatter
}
expression #second {
value: @exampleValue / COUNT(:responseid) * 100
formatter: percentNoDecimal
}
fontSize: 16
formatString: "{first} Responses ({second})"
}
select #rollupMode {
//Label: "Rollup mode"
options: @example.forSelect.data
}
}
3: Further Configuration with Custom Tiles
Using custom tiles, you can add formatters to the values in your toolbar widget.
3.1: Example 1
This example uses "bigNumberFormatter" and "integerDefaultFormatter"
View CDL
widget toolbarWidget {
tile custom {
expression #first {
value:192001222 //count(.response:)
formatter: bigNumberFormatter
}
expression #second {
value: responseRate() // 50
formatter: integerDefaultFormatter // 50%
}
fontSize: 16
formatString: "{first} Respondents ({second})"
}
tile custom {
expression #first {
value:192001222 //count(.response:)
formatter: noDecimalsUS
}
expression #second {
value: responseRate() // 50
formatter: percentDefaultFormatter // 50%
}
fontSize: 16
formatString: "{first} Respondents ({second})"
}
3.2: Example 2
This example uses "noDecimalsUS" and "percentDefaultFormatter".
View CDL
widget toolbarWidget {
tile custom {
expression #first {
value:192001222 //count(.response:)
formatter: noDecimalsUS
}
expression #second {
value: responseRate() // 50
formatter: percentDefaultFormatter // 50%
}
fontSize: 16
formatString: "{first} Respondents ({second})"
}