# 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 **Create Style** ![](https://950445536-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4GLkzIBhRPJYBUJD8p%2F-M4GLmpngX5uSfgbRicS%2F-M4GLxMzU6yir-OeB8Vf%2FConditional%20Styling%20-%20Create%20Style.png?generation=1586207922936341\&alt=media)
* 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

  ![](https://950445536-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4GLkzIBhRPJYBUJD8p%2F-M4GLmpngX5uSfgbRicS%2F-M4GLxN0NGxJD59HCDaW%2FConditional%20Styling%20-%20Name%20Style.png?generation=1586207923405852\&alt=media)

## 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.

      ![](https://950445536-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4GLkzIBhRPJYBUJD8p%2F-M4GLmpngX5uSfgbRicS%2F-M4GLxN2OGLG2KD_O2rP%2FConditional%20Styling%20-%20Appearance%20Tab%20Default.png?generation=1586207922725282\&alt=media)

## Set 1st Condition

* Navigate to the **Outline** tab.
* Right-click on your style.
* Select **Create Conditional Style** ![](https://950445536-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4GLkzIBhRPJYBUJD8p%2F-M4GLmpngX5uSfgbRicS%2F-M4GLxN460pNjjL8iHBj%2FConditional%20Styling%20-%20Create%20Condition.png?generation=1586207923758490\&alt=media)
* Double-click on **NO CONDITION SET**
* In the Expression Editor, **enter your 1st condition**.

  ![](https://950445536-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4GLkzIBhRPJYBUJD8p%2F-M4GLmpngX5uSfgbRicS%2F-M4GLxN6-d9SeWZd2VuI%2FConditional%20Styling%20-%20Set%201st%20Condition.png?generation=1586207923513063\&alt=media)

## 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

  ![](https://950445536-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4GLkzIBhRPJYBUJD8p%2F-M4GLmpngX5uSfgbRicS%2F-M4GLxN8-P8mo4cxq67f%2FConditional%20Styling%20-%20Set%20Style%20for%201st%20Condition.png?generation=1586207923202861\&alt=media)

## 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.

  ![](https://950445536-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4GLkzIBhRPJYBUJD8p%2F-M4GLmpngX5uSfgbRicS%2F-M4GLxNARh1eIla6iaiM%2FConditional%20Styling%20-%20Apply%20Conditional%20Styling.png?generation=1586207923987816\&alt=media)

### 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.
