0

I want to set font for the value of variable $V{Payment Frequency} in a Text Field, using this expression but to no vail

"Payment frequency is <style isBold='true' forecolor='blue'>$V{Payment Frequency}</style>"

What's wrong with it?

Alex K
  • 22,315
  • 19
  • 108
  • 236
bnguyen82
  • 6,048
  • 5
  • 30
  • 39

1 Answers1

0

The working (correct) expression in your case is:

"Payment frequency is <style isBold='true' forecolor='blue'>" + $V{Payment Frequency} + "</style>"

You should append the value of variable as the String in Java language.

Your expression is like this block in Java:

String paymentFrequency = "some value";
String textFieldValue = "Payment frequency is <style isBold='true' forecolor='blue'>$V{Payment Frequency}</style>";

And my expression:

String paymentFrequency = "some value";
String textFieldValue = "Payment frequency is <style isBold='true' forecolor='blue'>" + paymentFrequency + "</style>";

For more details about markup you can look at Style a text field in JasperReports post.

Community
  • 1
  • 1
Alex K
  • 22,315
  • 19
  • 108
  • 236