I will make my first report in jfreereport and I have the following doubt.
My report consists on several groups of rows, these groups will be shown or not according to the read data of the database.
In this case, how should I define the report format? using XML or in the code of the API. See page 23 in jfreereport-0.8.3-US.pdf
in JFreeReport (as in every report application) groups are used to divide a set of row into spearated sections (aka groups). These sections can also be divided (this creates subgroups).
So if you remove a group from the report, you just remove a ivision rule, and not any data. Have a look at the demos (SampleReport1 & 2) to see how groups are used to split a given set of rows.
If your reports have only a few alternative group setups, if may be easier to create separate reports for every choice. If you dont want that, you can now either use the API to define the reports or use the XML to create an initial report layout which is then modified by the API after the parsing.
Both ways of defining the report definition will produce the same results and both definition ways provide the same posibilities. Of course, the XML definition may be easier to edit and maintain ...
Have more fun,