Pick list values and titles in Jaspersoft Studio

Hi there,

I’ve created a new label with Jaspersoft Studio. It looks good, except of one important flaw:
In the page footer I use a field with a pick list, and the created label displays the database value of the given picklist items, not the stored titles of them (captions).
It is definitely not user friendly right now, but I got stuck with resolving it.

Do you have a best practice solution for this?

Thanks ahead,
Zsuzsanna

Specify 7 System Information - 2025-11-19T11_38_58.073Z.txt (4.5 MB)

Hi @ZsPapp,

Thanks for your question! This behavior has to do with how the Query Builder exports the values rather than the titles for pick lists.

For example, with the Agent Variant pick list:

A query will show “Variant” and “Author” in the results:

But when using the Create CSV button without selecting any results, it saves to my system with the “values” and not the “titles” for the pick list:

First Name,Last Name,Var Type,Variants
Grant,Fitzsimmons,0,Variant Name
Grant,Fitzsimmons,2,Author name

The Report & Label system effectively presents the results of a query export in a structured manner, inheriting this behavior as well.

If I setup an expression like this one, it can convert these values for me:

$F{5,107-variants.agentvariant.varType} == 1 ? "Vernacular" :
$F{5,107-variants.agentvariant.varType} == 0 ? "Variant" :
$F{5,107-variants.agentvariant.varType} == 4 ? "Label Name" :
$F{5,107-variants.agentvariant.varType} == 2 ? "Author" :
$F{5,107-variants.agentvariant.varType} == 3 ? "Author Abbrev." :
$F{5,107-variants.agentvariant.varType}

Now it appears like this:

You can do the same anywhere there is a discrepancy between the values and titles! Let me know if you need my help setting this up or if you run into any issues!

I’ve added this case to a GitHub issue tracking this functionality to ensure that the behavior matches what you see in the query results in the future:

Hi @Grant, thanks for your answer!

I considered to use an expression for this field, as you suggested, but I was a bit reluctant given this pick list has 33 values and it’s not even read only…
So it was worth a shot, but at the end I set up an expression for all the values/titles anyway. :slight_smile: I’m still hoping for a nicer solution, but it works afterall. :smiley:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.