specify / specify7

Specify 7
https://www.specifysoftware.org/products/specify-7/
GNU General Public License v2.0
62 stars 36 forks source link

Fields should display with their schema-assigned labels in Jaspersoft Studio #2072

Open grantfitzsimmons opened 2 years ago

grantfitzsimmons commented 2 years ago

Currently, when developing a report or label in Jaspersoft Studio, the field name is the one from the XML of the query.

This results in a very ugly, unintuitive display format when editing in Jaspersoft Studio:

"Det. "+($F{5.agent.firstName}==null?"":($F{5.agent.firstName}+" "))+($F{5.agent.lastName}==null?"":$F{5.agent.lastName})

In SpiReport, this would display as something like this:

"Det. "+($F{First Name}==null?"":($F{First Name}+" "))+($F{Last Name}==null?"":$F{Last Name})

This needs to be improved before moving away from iReport as the primary report developer.

maxpatiiuk commented 1 year ago

This is really tricky because:

The report definition XML does not have a "label" attribute - only "name"

Sp6 uses the "name" attribute, but since it has iReport bundled with it, they modified the source code to make iReport look into sp6 database and resolve database field names to field labels (at least that's what I think is happening) - not something we can do in Specify 7 with Jaspersoft Studio.

We wanted to ask Jaspersoft Studio if there is a way to solve this, but they only accept emails from members. Grant couldnt' find a post relevant to what we need on their open support forum

Adding any custom attributes to the report definition is not accepted by Jaspersoft Studio (according to Grant's testing)

Theoretically, we could use field labels instead of field names in the definition, and then resolve those back into names when running the report query, but of course that presents more problems:

@grantfitzsimmons tell me if I missed anything

grantfitzsimmons commented 1 year ago

Why are some stringIds not based on their database field name?

For instance: ($F{1,9-determinations,4-preferredTaxon.taxon.Species Author} or $F{1,9-determinations,4-preferredTaxon.taxon.Genus}

I suspect that it has to do with them being "virtual" fields. Can we not consider making the String ID based on the name in the schema?

maxpatiiuk commented 1 year ago

in the above, Species and Genus are rank names, not field names. I belive those are using the TaxonTreeDefItem.name The "Author" is hardcoded name in the code (in sp6, but also in sp7 for backward compatibility), along with ID and Group Number.

This is the issue for that - https://github.com/specify/specify7/issues/2364