Java Reference
In-Depth Information
Attribute
Description
Valid Values
isPdfEmbedded
Indicates if the PDF font
should be embedded in
the document.
true , false
forecolor
Indicates the color of the text.
See valid values for
forecolor in the Styles
section of this chapter.
backcolor
Indicates the background
color of the text.
See valid values for
backcolor in the Styles
section of this chapter.
We will be using styled text throughout this chapter. To see an example, see the
JRXML templates in the Subreports section later in this chapter.
There is one more way to set text properties, and that is by using
the <reportFont> and <font> elements. As of JasperReports 1.1,
these elements are deprecated and should not be used. Therefore,
we will not discuss them here. Refer to the quick reference section
of the JasperReports website if you need to use them: http://
jasperreports.sourceforge.net/quick.reference.html .
Setting a Report's Background
Reports can have elements that appear in the report background, behind all other
report elements. We can add any report element to the background by using the
JRXML <background> element. The following JRXML template demonstrates how to
do this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN"
"http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">
<jasperReport name="BackgroundDemoReport">
<style name="centeredText" hAlign="Center" vAlign="Middle"/>
<style name="boldCentered" style="centeredText" isBold="true"/>
<style name="backgroundStyle" style="boldCentered"
fontName="Helvetica" pdfFontName="Helvetica-Bold"
forecolor="lightGray" fontSize="90"/>
<background>
<band height="782">
<staticText>
<reportElement x="0" y="0" width="555" height="782"
style="backgroundStyle" mode="Transparent"/>
Search WWH ::




Custom Search