Conditional Styling in JasperSoft

To create conditional styles in JSS:

Create Your Style

  • Navigate to the top of the Outline tab.

  • Right-click on the Styles category.

  • Select the newly created Style1 in the Styles category.

  • Click on Properties Tab > Style

  • Name your style (change from default “Style1”

  • Set the default font/font size for your style

Set Default Style

  • Click on Appearance

  • Set the default Forecolor and Backcolor if necessary.

    • Forecolor controls the text color.

    • Backcolor controls the “Fill” or Background color.

      • NOTE: If you use a Backcolor, be sure to uncheck the “Transparent” box or your Backcolor will not show.

Set 1st Condition

  • Navigate to the Outline tab.

  • Right-click on your style.

  • Double-click on NO CONDITION SET

  • In the Expression Editor, enter your 1st condition.

Set Style for 1st Condition

  • Select the condition under your style in the Outline

  • Navigate to Properties Tab

  • Use Appearance, Border, & Style to set your conditional style

Repeat for 2nd, 3rd, 4th Condition, etc.

  • Right-click on your style.

  • Select Create Conditional Style

  • Double-click on NO CONDITION SET

  • In the Expression Editor, enter your 1st condition.

  • Select the condition under your style in the Outline

  • Navigate to Properties Tab

  • Use Appearance, Border, & Style to set your conditional style

Apply the Conditional Style to Your Field

  • Select a field on your report canvas

  • Navigate to the Properties tab

  • Under Appearance, select your conditional style from the drop-down menu.

TIP

  • Create your conditions in a logical order. The style from the first true condition will be applied to your field.

  • Why isn't my conditional style working? Any styling that was manually applied to your field(s) over-rides your conditional styling.

    If your conditional styling isn't working, select your field and navigate to Properties > Inheritance. Remove any styling in the Element Attributes area.

Last updated