html tag used for hyperlink doesn't work in Jasper Report

前端 未结 4 1663
我寻月下人不归
我寻月下人不归 2020-12-21 10:28

I want to make one word of a sentence as a hyperlink. I have written it as : Click on our website to know the details. The ma

相关标签:
4条回答
  • 2020-12-21 10:29

    The htm markup seems to be extremely limited. I have only found that it works for very basic html formating such as <i> and <b> tags. I do not think anchors or lists or any 'fancier' markup with do anything.

    0 讨论(0)
  • 2020-12-21 10:32

    Hyperlinks are not supported by static text fields - they only work with text field.. it worked when i used a text field and as the expression entered static text in quotes "click here etc" Then add a hyperlink by selecting hyperlink from the context menu..

    0 讨论(0)
  • 2020-12-21 10:33

    The HTML markups are only intended for the purpose of styling a text field. You are looking for the "Hyperlink" option. It doesn't work for static text fields though, but when you right click on a text field you should find the item "Hyperlink" in the context menu. This allows you to link the field to an anchor, another report or a webpage.

    0 讨论(0)
  • 2020-12-21 10:54

    I know the question is pretty old, but if somebody need a code, I will add it here:

    <textField>
        <reportElement positionType="Float" x="220" y="45" width="406" height="60"/>
        <textElement markup="html">
            <font fontName="Arial" size="8"/>
        </textElement>
        <textFieldExpression><![CDATA["Click on our"+"<u><font color='blue'><a href='http://www.google.co.in'>website</a></font></u>"]]> 
        </textFieldExpression>
    </textField>
    
    0 讨论(0)
提交回复
热议问题