Enum attribute in excel report doesn't show the corresponding caption

Hi Cuba Team,

In reports where there is an enum attribute the data shown is the ordinal value of the enumeration instead of the caption assigned to this value.

For example, next enumeration is defined:

public enum FacProvEstatEnum implements EnumClass<Integer> {


    private Integer id;

    FacProvEstatEnum(Integer value) {
        this.id = value;

    public Integer getId() {
        return id;

    public static FacProvEstatEnum fromId(Integer id) {
        for (FacProvEstatEnum at : FacProvEstatEnum.values()) {
            if (at.getId().equals(id)) {
                return at;
        return null;

Here it is the Excel template:

  • On the header section the first ${estat} is the value of the enum attribute choosen through parameters of the report.


The dataset is obtained with next JJPQL query:

e.numFactura as "numFactura",
e.dataFactura as "dataFactura",
proveidor.proNom as "proveidor.proNom",
e.estat as "estat",
e.importTotal as "importTotal",
e.percComissio as "percComissio",
e.importComissio as "importComissio",
e.importFob as "importFob",
e.venciment as "venciment",
e.dataCobrament as "dataCobrament",
e.dataReclamacio as "dataReclamacio"
from logis$FacturaProv e
left join e.proveidor proveidor 
where (e.estat = ${estat} and e.proveidor.id = ${proveidor1})

When the report is executed, first ask for parameters and the caption corresponding to the different enum attribute values are shown correctly:

The generated report doesn’t show the caption of the enum attribute values in the data section:

How should the caption of the enum attribute value be obtained on the data section?

Since you are using native SQL query you have to convert codes of the enumeration to caption string manually.

Hello @xlorentep,

Yuriy correctly said, you need to manually convert the data. You can use the groovy-script in “Value formats” for this.


Thanks, Yuriy and Nikita, for your comments to guide me finding the solution.