Configuring the Change color report
This example shows how to create modal buttons and
store the selection in report variables for further processing.
- Create a new Application Studio report named Change Color.
- In the Properties - Report pane, set the Immediate Writeback option to Automatic.
- Create a report variable named Selection.
- Create a report variable named Save.
- In the properties of the variable, specify FALSE as the default value and select False as the value of the Is Persistent option. This disables the Save button until a new color is selected.
- Create a global variable named Result. This global variable transfers the selection from the dialog box to the main report.
- Specify Change Color in the B2 cell.
- Specify Green in the C5 cell, Yellow in the C6 cell, Blue in the C7 cell, and Red in the C8 cell.
-
Insert this sample data into the F5:I7 cell range:
Key Caption Enabled Style ID1 Cancel TRUE secondary ID2 Save FALSE primary Note: The dialog box has two buttons. The Cancel button is a secondary button, contains a gray text, and is always enabled. The Save button is a primary button, contains a blue text, and is disabled until a value is selected. - Set the A1:D12 cell range to Visible Report Area.
-
Set the A12:D12 cell range to Footer
Area.
This range holds the web extension. Change the height of this row to at least 50 pixels to make the web extension fit in.
- Insert the modal buttons web extension in the A12:D12 cell range.
-
In the Format Web Extension dialog box, specify these
values:
- Theme
- Specify ="Vibrant".
- Mode
- Specify ="Light".
- List of Items
- Specify =F6:F7.
- Item Data
- Specify =F5:I7.
-
To save the color selection define action with these settings in cell C5:
- Actions
- Type
- Specify Set parameters.
- Condition
- Specify =TRUE.
- Mode
- Specify Hyperlink.
- Inputs/Options
- Refresh in web
- Specify Whole report.
- Parameters
- Name
- Specify Selection.
- Property
- Specify Value(.Text).
- Value
- Specify C5.
- Name
- Specify Save.
- Property
- Specify Value(.Text).
- Value
- Specify =TRUE.
- Actions
- Define the same action in cells C6, C7, and C8. Replace the cell coordinates respectively.
-
To close the dialog box, define an action with these settings in the F6
cell:
- Actions
- Type
- Specify Close dialog.
- Condition
- Specify =TRUE.
- Mode
- Specify Web Extension.
- Inputs/Options
- Name
- Specify Dialog result.
- Value
- Specify OK.
- Actions
-
To save the selection before closing, define an action with these settings in
the F7 cell:
- Actions
- Type
- Specify Close dialog.
- Condition
- Specify =TRUE.
- Mode
- Specify Web Extension.
- Inputs/Options
- Name
- Specify Dialog result.
- Value
- Specify OK.
- Parameters
- Name
- Specify Result.
- Property
- Specify Value(.Text).
- Value
- Specify =ReportVariables.Selection.Text.
- Actions
- Click OK.
- Save and view the report in a web browser.