Java Reference
In-Depth Information
indicates that the line will go from the top corner to the bottom corner. The default
value for the direction attribute is TopDown .
The following example demonstrates the use of the <line> element:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN"
<jasperReport name="LineDemoReport">
<band height="100">
<reportElement x="0" y="0" width="555" height="25"/>
<line direction="BottomUp">
<reportElement x="0" y="26" width="555" height="25"/>
<reportElement x="0" y="50" width="0" height="25"/>
<reportElement x="0" y="75" width="555" height="0"/>
After compiling the JRXML template and filling the resulting binary Jasper template,
we should get a report that looks like the following:
As can be seen in the example, the default value for direction is TopDown .
Moreover, since there is no way to directly create a vertical or horizontal line, one
way that we can achieve this is by setting either the width (for vertical lines) or
height �for horizontal lines) of the <reportElement> sub-element of <line> , to be
0 . Notice how the lines go from one corner of the area defined by <reportElement>
to the other. Altering the value of the direction attribute allows us to define which
way the line will slope.
Search WWH ::

Custom Search