Jump to content
We've recently updated our Privacy Statement, available here ×
  • Ampersand & in field values breaks styled text


    Friendly User
    • Features: Reports Product: JasperReports® Server

    Scenario:

    You have some fields containing ampersand symbol (&). The field value needs to be displayed in a styled text markup text field. When ampersand is present, the field styling disappears. How to avoid it?

    Solution:

    ampersands need to be escaped in this case since it's an XML and it doesn't process them properly. Try to replace the ampersand symbol with XML escape code & For example: "<sub>"+$F{fieldname}.replace("&", "&")+"</sub>

     


    User Feedback

    Recommended Comments

    There are no comments to display.



    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

×
×
  • Create New...