O'Reilly logo

JasperReports 3.5 for Java Developers by David Heffelfinger

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Setting text properties

JasperReports provides several ways to control text properties in the report. We can control the font, whether the text is bold, italic, underlined, its background and foreground colors, and so on.

Styles

One way JasperReports allows us to control text properties is by using the<style> element. This element allows us to control the foreground and background colors, the style of font (bold, italic, or normal), the font size, a border for the font, and many other attributes. Styles can extend other styles and add to or override properties of the parent style.

The following JRXML template illustrates the use of styles:

<?xml version="1.0" encoding="UTF-8" ?> <jasperReport name="ReportStylesDemo" xmlns="http://jasperreports.sourceforge.net/ ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required