Skip to main content
Administrator Guide
Last Updated: 2023-06-23
Use JavaScript to Conditionally Alter Layout

Use JavaScript to Conditionally Alter Layout

Create a report design file.
You can use JavaScript expressions to conditionally alter the layout of your report design. For example, you might want to change the font color in a particular field, based on values in the report.
  1. On the
    Layout
    or
    Master
    tab of the main view, select the report item to which you want to apply conditional formatting.
  2. Open the item's
    Property Editor
    view and select the
    Highlights
    tab.
  3. Click
    Add
    to create your new formatting rule. The rule has 2 parts: a condition and a format. When the condition is met, Report Designer applies the format.
  4. In
    Condition
    section of the
    New Highlight
    dialog box, set the condition that you want to test for. In the field on the left, specify the first part of the conditional expression. Click
    Fx
    to enter JavaScript expressions in the Expression Builder.
  5. In the central drop-down list, select an operator.
  6. In the field on the right, specify the final part of the conditional expression. Example completed conditional expression:
    row["OrderTotal"] Greater Than 1000
    .
  7. In the
    Format
    section, specify the formatting that should apply if the condition is met. Example: set the font color to red.