# How to color a custom row in a Report Table?

**URL:** <https://forum.inductiveautomation.com/t/how-to-color-a-custom-row-in-a-report-table/97237>\
**Category:** Ignition\
**Tags:** reporting\
**Created:** [October 14, 2024, 6:34pm UTC](https://forum.inductiveautomation.com/t/how-to-color-a-custom-row-in-a-report-table/97237 "2024-10-14T18:34:57Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mdemaris](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mdemaris/32/54639_2.png) [@mdemaris](https://forum.inductiveautomation.com/u/mdemaris)\
**Post date:** [October 14, 2024, 6:34pm UTC](https://forum.inductiveautomation.com/t/how-to-color-a-custom-row-in-a-report-table/97237/1 "2024-10-14T18:34:57Z")

</div>

Hello, using 8.1.43, Reporting Module.

The docs tell me I can use a dynamic data key to color rows of a table component that meet certain criteria.  
I have a named query data source, standard table, header and row details setup. I enabled `Alternate Row` on the details, then added a custom row for low inventory.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/f/bfb13853a5ceec71e0b06afbcb2040b5d881e044.png)

On the Fill:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/d/4d73aec638ac14292634d0f9977c4b9f1bbdad57.png)

The column name is `CurrentStock`. No matter the number value I use, I don't see any light red in the preview. (Note: I just created a report viewer to see it live, and still no red.)

So, I tried the `keychain` syntax: `named_query.CurrentStock`, still no dice. Not sure where to go from here.

Note: just tried this, below and nothing.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/b/8b7ffd1386dad7574eda0b6c661eedb3121eeb6b.png)

One other unrelated question on reports: The data spills over onto a second page, but the header and data are at the bottom, instead of the top. Why is this and how can I fix it?

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [October 14, 2024, 6:40pm UTC](https://forum.inductiveautomation.com/t/how-to-color-a-custom-row-in-a-report-table/97237/2 "2024-10-14T18:40:29Z")

</div>

Try this

~~

```python
@CurrentStock<=5?"FF8A8A"@

```

~~EDIT Acutally, it might be because you didn't provide a fallback value

```python
CurrentStock<=5?"FF8A8A":"FFFFFF"

```

---

<div class="post-metadata">

**Author:** ![mdemaris](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mdemaris/32/54639_2.png) [@mdemaris](https://forum.inductiveautomation.com/u/mdemaris)\
**Post date:** [October 14, 2024, 7:51pm UTC](https://forum.inductiveautomation.com/t/how-to-color-a-custom-row-in-a-report-table/97237/3 "2024-10-14T19:51:02Z")

</div>

That didn't work either. And no `@` are used here. see [Data Keys](https://docs.inductiveautomation.com/docs/8.1/ignition-modules/reporting/report-design/data-keys)

Edit: I removed the `Alternate Row` just in case that was interfering, but got nothing.

---

<div class="post-metadata">

**Author:** ![josborn](https://avatars.discourse-cdn.com/v4/letter/j/4bbf92/32.png) [@josborn](https://forum.inductiveautomation.com/u/josborn)\
**Post date:** [October 14, 2024, 8:30pm UTC](https://forum.inductiveautomation.com/t/how-to-color-a-custom-row-in-a-report-table/97237/4 "2024-10-14T20:30:41Z")

</div>

If there is only one color you want to use for the one condition, just set the fill color with the color picker then set the fill to `CurrentStock<=5`, this should work.

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [October 14, 2024, 8:30pm UTC](https://forum.inductiveautomation.com/t/how-to-color-a-custom-row-in-a-report-table/97237/5 "2024-10-14T20:30:54Z")

</div>

> [@dkhayes117](#):
>
> `CurrentStock<=5?"FF8A8A":"FFFFFF"`

I tried it on one of my reports, and it worked.

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/9/093fb3805fdf9baa83f5b0edb35a4e5271c6a27c.png)

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/6/d64341c9fe3c062eda2d97827e64c0dd3f80ca99.png)

EDIT: I didn't need the `red` fallback as I had an expression in `fill`

---

<div class="post-metadata">

**Author:** ![mdemaris](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mdemaris/32/54639_2.png) [@mdemaris](https://forum.inductiveautomation.com/u/mdemaris)\
**Post date:** [October 14, 2024, 10:48pm UTC](https://forum.inductiveautomation.com/t/how-to-color-a-custom-row-in-a-report-table/97237/7 "2024-10-14T22:48:01Z")

</div>

Ok, I got it to work, but I am not sure what the problem is, or actually I am not sure _ **why** _ the problem is.

I put the red coloring on a custom details row, like you click this:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/9/195d46b1eb5cd9c90ac1dc14eb222d6a450461d9.png)

add your custom row version... and that's where the condition `stock<=5` was placed. After I added the conditional coloring to the `standard` row version, then I saw `red`.

Some thoughts on this:

- Why does the `custom row version` not display? (See the first image in the first post "LowInv".
- Why does the `alternate row version` override the conditional coloring on the `standard row version`?

---

<div class="post-metadata">

**Author:** ![josborn](https://avatars.discourse-cdn.com/v4/letter/j/4bbf92/32.png) [@josborn](https://forum.inductiveautomation.com/u/josborn)\
**Post date:** [October 15, 2024, 12:08am UTC](https://forum.inductiveautomation.com/t/how-to-color-a-custom-row-in-a-report-table/97237/8 "2024-10-15T00:08:13Z")

</div>

I must admit I didn't know custom row versioning existed, and did not find it that intuitive.

As far as I can tell its whole thing is to override the standard row version for rows that meet the criteria.

As for your first bullet point, if the Version Key keychain expression results in **the name of your custom row version** it would apply the stroke and fill as configured for that custom row version.
