| 1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> |
| 2 |
<html> |
| 3 |
<body bgcolor="white"> |
| 4 |
Main classes in the JFreeReport class library. |
| 5 |
<p> |
| 6 |
Some rules when working with the report definition objects: |
| 7 |
<ul> |
| 8 |
<li>Functions cannot be added to the report once the report generation has |
| 9 |
started. |
| 10 |
<li>Do not modify the report structure after the report |
| 11 |
generation is started, unless you know exactly what you are doing. |
| 12 |
<li>It is safe to modify the report definition <b>before</b> the report is |
| 13 |
started. |
| 14 |
<li>Once the report processing has started, the report from the report |
| 15 |
processor must not be reused for other purposes. |
| 16 |
</ul> |
| 17 |
</p> |
| 18 |
<h2>Groups</h2> |
| 19 |
<p> |
| 20 |
A group is a set of database rows, where the contents of the group |
| 21 |
fields are equal for all rows. |
| 22 |
</p> |
| 23 |
<p> |
| 24 |
Lets look at the following table: |
| 25 |
</p> |
| 26 |
<p> |
| 27 |
<table> |
| 28 |
<tr><th>Car</th><th>Color</th><th>Price</th></tr> |
| 29 |
<tr><td>Toyota</td><td>blue</td><td>10.000</td></tr> |
| 30 |
<tr><td>Toyota</td><td>blue</td><td>20.000</td></tr> |
| 31 |
<tr><td>Toyota</td><td>red</td><td>15.000</td></tr> |
| 32 |
<tr><td>Lexus</td><td>blue</td><td>25.000</td></tr> |
| 33 |
<tr><td>Lexus</td><td>yellow</td><td>15.000</td></tr> |
| 34 |
<tr><td>BMW</td><td>yellow</td><td>40.000</td></tr> |
| 35 |
<tr><td>BMW</td><td>blue</td><td>35.000</td></tr> |
| 36 |
<tr><td>BMW</td><td>green</td><td>5.000</td></tr> |
| 37 |
</table> |
| 38 |
</p> |
| 39 |
<p> |
| 40 |
Groups are always defined on sorted tables. |
| 41 |
A group is defined by selecting one or more rows, which should |
| 42 |
form the group. A group instance will contain all rows from the |
| 43 |
beginning of the group until one of the group fields changes. |
| 44 |
</p> |
| 45 |
<p> |
| 46 |
Lets select the row car for our group: |
| 47 |
</p> |
| 48 |
<p> |
| 49 |
Selecting that row as group argument will result in 3 group instances. |
| 50 |
The first group instance will contain the first 3 rows (as the contents |
| 51 |
of these rows are equal). |
| 52 |
</p> |
| 53 |
<p> |
| 54 |
The next instance will contain all rows of the "Lexus" car and the |
| 55 |
last group contains all rows from the "BMW" rows. |
| 56 |
</p> |
| 57 |
<p> |
| 58 |
If a group is defined by more than one field, then the group will end, |
| 59 |
if one of the group member fields changes. |
| 60 |
</p> |
| 61 |
<p> |
| 62 |
Lets define a group which consists of "Car" and "Color". |
| 63 |
</p> |
| 64 |
<p> |
| 65 |
The first instance of the group will contain the first 2 rows (Toyota,blue). |
| 66 |
Then the value in the column "Color" changes, so a new group |
| 67 |
instance is started. This new group contains a single row, as the |
| 68 |
column "Car" in the next row will contain a different value. |
| 69 |
</p> |
| 70 |
<p> |
| 71 |
The next two group instances are "Lexus, blue" and "Lexus, yellow", both |
| 72 |
group instances contain 1 row, as the color changes after 1 row. |
| 73 |
</p> |
| 74 |
<p> |
| 75 |
The next row starts a new group, as the column "Car" contains a different |
| 76 |
value (BWM instead of Lexus). It doesn't matter, that the color is still |
| 77 |
equal, to end a group instance, it is sufficient that one column value |
| 78 |
changed. |
| 79 |
</p> |
| 80 |
</body> |
| 81 |
</html> |