How to Bold the text inside the variable expression in Jasper Reports - BOOKC -->

How to Bold the text inside the variable expression in Jasper Reports

Tuesday, July 17, 2018

Jasper Reports | Bolding text in variable expression is not a big issue in jasper reports using iReport. The question raise here that why we need this. For example we want to show some text with bold font and center align in a line or row. If we do that using two text fields the first one is static text and the second is text field, by using this technique we achieve our goal, but the alignment of text will be disturb. So to overcome this issue we use variables to show text with blod font instead of taking two fields. Follow below steps to handle above issue.


jasper reports



Bold the text inside the variable expression in Jasper Reports

1- Create a variable

2- Set variable expression, in variable expression we will concatenate our text with text field with bold font tag.

jasper reports


3- Set variable field "Markup" property to "HTML".

jasper reports


4- If you will not set the "Markup" property to "HTML", than bold tag "<b></b>" shows as it is.

jasper reports


Finally your report looks like this with bold and center align.

jasper reports