<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Hi,</p>
    <p>I've got the same problem: the solution given here
      <a class="moz-txt-link-freetext" href="https://lists.evolveum.com/pipermail/midpoint/2016-July/002135.html">https://lists.evolveum.com/pipermail/midpoint/2016-July/002135.html</a>
      is not working anymore.</p>
    <p>Any solution to access user's extension schema attributes in
      jasper reports ?</p>
    <p>Thanks<br>
    </p>
    <div class="moz-cite-prefix">Le 20/10/2020 à 10:31, Peter Holes via
      midPoint a écrit :<br>
    </div>
    <blockquote type="cite"
cite="mid:CAJ_HHo9DkZuM4FeoqMEHb3JZK8FT_AADMyVcMEdK__Qxa1N0pQ@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">Hi,
        <div><br>
        </div>
        <div>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.</div>
        <div><br>
        </div>
        <div>Our old definition in jasperTemplate is like this (works
          until 3.9)</div>
        <div><jasperReport></div>
        <div>...</div>
        <div>  <!-- extension attribute definition -->  <br>
        </div>
        <div><field name="extension/streetAddress"
          class="java.lang.String"/><br>
          <field name="extension/propertyNumber"
          class="java.lang.String"/><br>
          <field name="extension/city" class="java.lang.String"/><br>
          <field name="extension/postalCode"
          class="java.lang.String"/><br>
        </div>
        <div>...<br>
        </div>
        <div><!-- using the attributes in report definition as
          textField--></div>
        <div><textField isStretchWithOverflow="true"
          isBlankWhenNull="false"><br>
          <reportElement style="Text" x="10" y="280" width="650"
          height="30" uuid="a3d99cad-9d84-4f50-b455-453c87f62c4c"/><br>
          <textElement verticalAlignment="Middle"><br>
          <font isBold="true"/><br>
          </textElement><br>
<textFieldExpression><![CDATA[$F{extension/streetAddress} + " "
          + $F{extension/propertyNumber} + ", "+
          $F{extension/postalCode} + " "+
          $F{extension/city}]]></textFieldExpression><br>
          </textField><br>
        </div>
        <div>...</div>
        <div></jasperReport><br clear="all">
          <div>
            <div dir="ltr" class="gmail_signature"
              data-smartmail="gmail_signature">
              <div dir="ltr">
                <div dir="ltr">
                  <div dir="ltr">
                    <div><br>
                    </div>
                    <div>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?</div>
                    <div>thx in advance.</div>
                    <div><br>
                    </div>
                    <div>Peter.</div>
                    <div><br>
                    </div>
                    <div>here is the whole stackTrace:</div>
                    <div>##</div>
                    <div>ERROR
                      (com.evolveum.midpoint.model.common.expression.script.ScriptExpression):
                      Expression error: No such property: extension for
                      class: report_script in report script<br>
com.evolveum.midpoint.util.exception.ExpressionEvaluationException: No
                      such property: extension for class: report_script
                      in report script<br>
                              at
com.evolveum.midpoint.model.common.expression.script.AbstractCachingScriptEvaluator.evaluate(AbstractCachingScriptEvaluator.java:84)<br>
                              at
com.evolveum.midpoint.model.common.expression.script.ScriptExpression.evaluate(ScriptExpression.java:187)<br>
                              at
com.evolveum.midpoint.report.impl.ReportServiceImpl.evaluateReportScript(ReportServiceImpl.java:411)<br>
                              at
com.evolveum.midpoint.report.impl.ReportServiceImpl.evaluate(ReportServiceImpl.java:270)<br>
                              at
com.evolveum.midpoint.report.impl.JRMidpointEvaluator.evaluateExpression(JRMidpointEvaluator.java:185)<br>
                              at
com.evolveum.midpoint.report.impl.JRMidpointEvaluator.evaluate(JRMidpointEvaluator.java:121)<br>
                              at
net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:671)<br>
                              at
net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:639)<br>
                              at
net.sf.jasperreports.engine.fill.JRFillElement.evaluateExpression(JRFillElement.java:1164)<br>
                              at
net.sf.jasperreports.engine.fill.JRFillTextField.evaluateText(JRFillTextField.java:526)<br>
                              at
net.sf.jasperreports.engine.fill.JRFillTextField.evaluate(JRFillTextField.java:510)<br>
                              at
net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluate(JRFillElementContainer.java:383)<br>
                              at
net.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java:533)<br>
                              at
net.sf.jasperreports.engine.fill.JRVerticalFiller.fillTitle(JRVerticalFiller.java:308)<br>
                              at
net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:244)<br>
                              at
net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:99)<br>
                              at
net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:609)<br>
                              at
                      net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:182)<br>
                              at
net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:474)<br>
                              at
net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:875)<br>
                              at
com.evolveum.midpoint.report.impl.ReportJasperCreateTaskHandler.run(ReportJasperCreateTaskHandler.java:248)<br>
                              at
com.evolveum.midpoint.task.quartzimpl.execution.HandlerExecutor.executePlainTaskHandler(HandlerExecutor.java:62)<br>
                              at
com.evolveum.midpoint.task.quartzimpl.execution.HandlerExecutor.executeHandler(HandlerExecutor.java:52)<br>
                              at
com.evolveum.midpoint.task.quartzimpl.execution.JobExecutor.executeHandler(JobExecutor.java:637)<br>
                              at
com.evolveum.midpoint.task.quartzimpl.execution.JobExecutor.executeSingleTask(JobExecutor.java:456)<br>
                              at
com.evolveum.midpoint.task.quartzimpl.execution.JobExecutor.execute(JobExecutor.java:178)<br>
                              at
                      org.quartz.core.JobRunShell.run(JobRunShell.java:202)<br>
                              at
org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:588)<br>
                      Caused by: groovy.lang.MissingPropertyException:
                      No such property: extension for class:
                      report_script<br>
                              at
org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:65)<br>
                              at
org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(PogoGetPropertySite.java:51)<br>
                              at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:309)<br>
                              at report_script.run(report script:1)<br>
                              at
com.evolveum.midpoint.model.common.expression.script.groovy.GroovyScriptEvaluator.evaluateScript(GroovyScriptEvaluator.java:203)<br>
                              at
com.evolveum.midpoint.model.common.expression.script.groovy.GroovyScriptEvaluator.evaluateScript(GroovyScriptEvaluator.java:50)<br>
                              at
com.evolveum.midpoint.model.common.expression.script.AbstractCachingScriptEvaluator.evaluate(AbstractCachingScriptEvaluator.java:76)<br>
                              ... 27 common frames omitted<br>
                    </div>
                    <div>##<br>
                    </div>
                    <div><br>
                    </div>
                    <div><br>
                    </div>
                    <div><span style="font-size:12.8px">Sent from Sony
                        Xperia™ smartphone.</span><br>
                    </div>
                    <div style="font-size:small">Please excuse any
                      typos.</div>
                    <div style="font-size:small"><br>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
midPoint mailing list
<a class="moz-txt-link-abbreviated" href="mailto:midPoint@lists.evolveum.com">midPoint@lists.evolveum.com</a>
<a class="moz-txt-link-freetext" href="https://lists.evolveum.com/mailman/listinfo/midpoint">https://lists.evolveum.com/mailman/listinfo/midpoint</a>
</pre>
    </blockquote>
  </body>
</html>