I am using DynamicJasper to generate reports from some tables at run time. I have some fields that the data has been styled using basic html tags as the data was created. Very basic tags like bold and italic, and jasper reports can handle them by setting the markup
attribute of the textElement to html
. The problem is a can not find a way to change it using DynamicJasper.
I have tried using addFieldProperty("markup", "html")
found in ColumnBuilder
, but that adds markup as a property to the field markup (probably obvious that it should do that based on the name) instead of the text elemennt.
How to you change the markup value for a text element using DynamicJasper?
The DynamicJasper API does not contain methods to set
markup
.But you can use JasperReports API for this needs. For example, the JRBasePrintText class and JRCommonText interface have method for setting
markup
:The JRCommonText interface has constant fields:
You can modify DynamicJasper classes for your needs like in this post, for example.