Search Here

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

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.


How to Bold the text inside the variable expression in 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.

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


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

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


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

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


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

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


Post a Comment

0 Comments