[midPoint] extension attributes in reports (midpoint 4.x)
Pascal PÉRICHON
pascal.perichon at u-paris.fr
Fri Apr 16 12:53:23 CEST 2021
Hi,
I've got the same problem: the solution given here
https://lists.evolveum.com/pipermail/midpoint/2016-July/002135.html is
not working anymore.
Any solution to access user's extension schema attributes in jasper
reports ?
Thanks
Le 20/10/2020 à 10:31, Peter Holes via midPoint a écrit :
> Hi,
>
> Is anybody who already migrated his custom reports from old midpoint
> 3.x version to a new 4.x version? We have an issue with external
> attributes definition and are not able to resolve it.
>
> Our old definition in jasperTemplate is like this (works until 3.9)
> <jasperReport>
> ...
> <!-- extension attribute definition -->
> <field name="extension/streetAddress" class="java.lang.String"/>
> <field name="extension/propertyNumber" class="java.lang.String"/>
> <field name="extension/city" class="java.lang.String"/>
> <field name="extension/postalCode" class="java.lang.String"/>
> ...
> <!-- using the attributes in report definition as textField-->
> <textField isStretchWithOverflow="true" isBlankWhenNull="false">
> <reportElement style="Text" x="10" y="280" width="650" height="30"
> uuid="a3d99cad-9d84-4f50-b455-453c87f62c4c"/>
> <textElement verticalAlignment="Middle">
> <font isBold="true"/>
> </textElement>
> <textFieldExpression><![CDATA[$F{extension/streetAddress} + " " +
> $F{extension/propertyNumber} + ", "+ $F{extension/postalCode} + " "+
> $F{extension/city}]]></textFieldExpression>
> </textField>
> ...
> </jasperReport>
>
> This works smoothly until the 3.9 version. In new midpoint 4.x we have
> an error in a log file containing an error with no such property:
> extension. It seems that something should be changed in the attribute
> definition but I can't find the correct definition. Already try using
> the quotation marks, evaluate extension attributes from the focus
> object but still have the same or similar errors. Any idea or hint how
> to fix extension attributes definition in jasperReport?
> thx in advance.
>
> Peter.
>
> here is the whole stackTrace:
> ##
> ERROR
> (com.evolveum.midpoint.model.common.expression.script.ScriptExpression):
> Expression error: No such property: extension for class: report_script
> in report script
> com.evolveum.midpoint.util.exception.ExpressionEvaluationException: No
> such property: extension for class: report_script in report script
> at
> com.evolveum.midpoint.model.common.expression.script.AbstractCachingScriptEvaluator.evaluate(AbstractCachingScriptEvaluator.java:84)
> at
> com.evolveum.midpoint.model.common.expression.script.ScriptExpression.evaluate(ScriptExpression.java:187)
> at
> com.evolveum.midpoint.report.impl.ReportServiceImpl.evaluateReportScript(ReportServiceImpl.java:411)
> at
> com.evolveum.midpoint.report.impl.ReportServiceImpl.evaluate(ReportServiceImpl.java:270)
> at
> com.evolveum.midpoint.report.impl.JRMidpointEvaluator.evaluateExpression(JRMidpointEvaluator.java:185)
> at
> com.evolveum.midpoint.report.impl.JRMidpointEvaluator.evaluate(JRMidpointEvaluator.java:121)
> at
> net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:671)
> at
> net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:639)
> at
> net.sf.jasperreports.engine.fill.JRFillElement.evaluateExpression(JRFillElement.java:1164)
> at
> net.sf.jasperreports.engine.fill.JRFillTextField.evaluateText(JRFillTextField.java:526)
> at
> net.sf.jasperreports.engine.fill.JRFillTextField.evaluate(JRFillTextField.java:510)
> at
> net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluate(JRFillElementContainer.java:383)
> at
> net.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java:533)
> at
> net.sf.jasperreports.engine.fill.JRVerticalFiller.fillTitle(JRVerticalFiller.java:308)
> at
> net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:244)
> at
> net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:99)
> at
> net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:609)
> at
> net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:182)
> at
> net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:474)
> at
> net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:875)
> at
> com.evolveum.midpoint.report.impl.ReportJasperCreateTaskHandler.run(ReportJasperCreateTaskHandler.java:248)
> at
> com.evolveum.midpoint.task.quartzimpl.execution.HandlerExecutor.executePlainTaskHandler(HandlerExecutor.java:62)
> at
> com.evolveum.midpoint.task.quartzimpl.execution.HandlerExecutor.executeHandler(HandlerExecutor.java:52)
> at
> com.evolveum.midpoint.task.quartzimpl.execution.JobExecutor.executeHandler(JobExecutor.java:637)
> at
> com.evolveum.midpoint.task.quartzimpl.execution.JobExecutor.executeSingleTask(JobExecutor.java:456)
> at
> com.evolveum.midpoint.task.quartzimpl.execution.JobExecutor.execute(JobExecutor.java:178)
> at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
> at
> org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:588)
> Caused by: groovy.lang.MissingPropertyException: No such property:
> extension for class: report_script
> at
> org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:65)
> at
> org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(PogoGetPropertySite.java:51)
> at
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:309)
> at report_script.run(report script:1)
> at
> com.evolveum.midpoint.model.common.expression.script.groovy.GroovyScriptEvaluator.evaluateScript(GroovyScriptEvaluator.java:203)
> at
> com.evolveum.midpoint.model.common.expression.script.groovy.GroovyScriptEvaluator.evaluateScript(GroovyScriptEvaluator.java:50)
> at
> com.evolveum.midpoint.model.common.expression.script.AbstractCachingScriptEvaluator.evaluate(AbstractCachingScriptEvaluator.java:76)
> ... 27 common frames omitted
> ##
>
>
> Sent from Sony Xperia™ smartphone.
> Please excuse any typos.
>
>
> _______________________________________________
> midPoint mailing list
> midPoint at lists.evolveum.com
> https://lists.evolveum.com/mailman/listinfo/midpoint
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.evolveum.com/pipermail/midpoint/attachments/20210416/e2e76696/attachment.htm>
More information about the midPoint
mailing list