Java Reference
In-Depth Information
The
<graphicElement>
sub-element has only two attributes. The first one is called
pen
, and is used to control the thickness of the line outlining the graphic element.
Valid values for the
pen
attribute include
1Point
,
2Point
,
4Point
,
Dotted
,
None
,
and
Thin
. Each of these gives a different thickness to the line outlining the element.
The other attribute of
<graphicElement>
is called
fill
. It controls the pattern to be
used for painting the inside area of the element. Currently, JasperReports supports
only one value for this element,
Solid
, which fills the inside of the element with
solid color.
Adding Ellipses to a Report
Ellipses are added to a report by using the JRXML
<ellipse>
element. The
<ellipse>
element contains no attributes. Its shape is determined by its
<reportElement>
width
and
height
.
The following JRXML template illustrates how to add ellipses to a report:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jasperReport PUBLIC "-//JasperReports//DTD Report Design//EN"
"http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">
<jasperReport name="EllipseDemoReport">
<detail>
<band height="100">
<ellipse>
<reportElement x="280" y="0" height="20" width="20"/>
</ellipse>
<ellipse>
<reportElement x="280" y="20" height="50" width="20"/>
</ellipse>
<ellipse>
<reportElement x="275" y="60" height="40" width="10"/>
</ellipse>
<ellipse>
<reportElement x="295" y="60" height="40" width="10"/>
</ellipse>
<ellipse>
<reportElement x="297" y="25" height="10" width="30"/>
</ellipse>
<ellipse>
<reportElement x="253" y="25" height="10" width="30"/>
</ellipse>
</band>
</detail>
</jasperReport>