Cannot get unfetched attribute when running Report

Hi

I am creating a report with the wizard. I add fields from the entity and the report is running. If I add a band than I get the error below. This only happens to one entity type. Other entities with bands work ok. I added in a view all the associations with fields needed in the band but no luck.

The wizard also ads a band with no dataset like “headerWorkOrderAlarmLines2” which I think is unusual.

What do I need to check? How do I debug?

Thank you

An error occurred while loading data for band [WorkOrderAlarmLines2] and query [Dataset]. Report name [Report for entity “Work Order”]
java.lang.reflect.InvocationTargetException
null
Cannot get unfetched attribute [alarms] from detached object ro.gsdata.spicawind.entity.WorkOrder-51a81393-8e1c-7503-a270-a73d7745b80e [detached].

The fields that generate the error are composition fields, not association, not sure if the distinction makes any difference

the problem appears when I add a value to a transient string field in onBeforeDetach … any workaraound?

Hi,
Let me bring an example of a report for a composition of entities.
WorkOrder is a composition of Alarms in my test project. The report which prints one WorkOrder and a list of related Alarms is the following.

  1. The DOCX report is created by wizard. An appropriate template and a band is generated as result
  2. Generated WorkOrder band has the “entity” type and one parameter “entity”.
  3. After that, the band for AlarmLines is added as a child of WorkOrder. It also as the parameter: ID of the WorkOrder from the parent band.
  4. For printing the list of Alarms, a table is added to the template as described in the documentation.

The report works well.
Regarding the “Unfetched attribute” error. Could you bring more details of the report structure? Which bands has it? Which type and parameters have each of them?

5fd0e488a727449ccbabd1fc3e34d1b4

Hi Rostislav
Thank you for your reply

In my onBeforeDetach entity listener I am setting the value for a transient field (Datastructure String). This field belongs to the main entity Workorder.

I have made the field stored in the database and I have set it’s value in onBeforeInsert entity listener and now it works fine.

Kind regards
George