Tuesday, 4 February 2020

Tip : Styled Markup for color and font size together in Jaspersoft Studio Reports

In J.Design  Studio: Drag a text field (not static text) and in the properties give Markup=Styled


Expression inside text field :
"<style forecolor='#ffffff' size='14'> Hi,I am red in color..!</style>"

Sample output: 

References: 
https://community.jaspersoft.com/blog/tip-half-colored-text-static-text-field-or-text-field-jasper-reports-or-basic-usage-markup

https://infosys.ars.usda.gov/svn/code/third_party/Jasper_Reports/jasperreports-4.6.0-project/jasperreports-4.6.0/dist/docs/sample.reference/styledtext/index.html

attributes supported by the <style isBold="true">style</style> 
 tag used to format the text content inside a styled text element:
 
 fontName
 <style size="32">size</style>
 <style isBold="true">isBold</style>
 <style isItalic="true">isItalic</style>
 <style isUnderline="true">isUnderline</style>
 <style isStrikeThrough="true">isStrikeThrough</style>
 pdfFontName
 pdfEncoding
 isPdfEmbedded
 <style forecolor="red">forecolor</style>
 <style backcolor="blue" forecolor="white" isBold="true">backcolor</style>

No comments:

Post a Comment