Can I use dynamic attributes in Report addon?
such as:
Air Dry Density: ${+Species.densityAirDry}
Can I use dynamic attributes in Report addon?
such as:
Air Dry Density: ${+Species.densityAirDry}
Hello,
In general - no.
But if you use Groovy dataset you can load data via dataManager
including dynamic attributes and fill the output result.
Something like this:
import com.company.sandbox.entity.TestEntity
import io.jmix.dynattr.DynAttrQueryHints
import io.jmix.core.entity.EntityValues
List<TestEntity> list = dataManager.load(TestEntity.class)
.all()
.hint(DynAttrQueryHints.LOAD_DYN_ATTR, true)
.list();
return list.collect {[
'name': it.name,
'dynamicAttributeValue': EntityValues.getValue(it, "+dynamicAttributeCode")
]}
Regards,
Ivan