How can I call hyperlink in a part of textField?


I have the following textField, but I want the hyperlink only in this part of text: "decreto nº 8.539, de 8 de outubro de 2015." How can I do it?

The following code puts the hyperlink in the whole text.


  <textField isBlankWhenNull="true" hyperlinkType="Reference">
      <reportElement uuid="f9422a97-9088-4dcf-bbc5-c9ff5449ff15" isPrintRepeatedValues="false" x="-1" y="149" width="535" height="38" isRemoveLineWhenBlank="true" isPrintWhenDetailOverflows="true"/>
      <textElement textAlignment="Center" verticalAlignment="Middle">
          <font size="8"/>
      <textFieldExpression><![CDATA["Documento assinado eletronicamente por " + $F{dsUsuarioDeferimento} +  " ,  em " + $F{dtDeferimento} +  " , com fundamento no art. 6º, § , 1º, do decreto nº 8.539, de 8 de outubro de 2015."]]></textFieldExpression>
      <anchorNameExpression><![CDATA["decreto nº 8.539, de 8 de outubro de 2015."]]></anchorNameExpression>

stenio.vilar's picture
Joined: Mar 27 2019 - 2:21pm
Last seen: 1 month 3 weeks ago

1 Answer:


You'll need to break it up into separate fields


make your text include the '<a href=' and then set Markup to 'html'

                <reportElement x="400" y="0" width="100" height="30" uuid="24d2d9fb-41ea-44b1-bece-83c0eeb97f91"/>
                <textElement markup="html"/>
                <textFieldExpression><![CDATA["Text <a href=''>Field</a>"]]></textFieldExpression>

hozawa's picture
Joined: Apr 24 2010 - 4:31pm
Last seen: 2 days 3 hours ago