Few Points Needs to Remember While Developing JRXML
1) Use .equals() comparison operator for String fields
If you want to compare string fields then use .equals() function instead of == operator. In Java, the == operator compares if the objects are the same instance while .equals() compares the state of object.
2) JRXML Detail Band
Detail band executes, N number of times where N is equal to number of rows return by main dataset. Which means if your main dataset return 3 rows then detail band will execute three times in order to print data.
Tip: If you are not using a query in your main dataset then put either select 1 as one or set daproperty “When No Data Type” = “All Section No Detail”.
Note: All Section No Detail prints all other bands except detail band. Suppose if you are using a table componant in your detail band and you have set property “When No Data Type” = “All Section No Detail” then it will not print table data because of the property.
3) Print When Expression
You can set print when expression for each componant in your JRXML but there is limitation of using it.
Print When Expression checks only main dataset’s variable , fields and parameter. For example you are using a table componant and you want to hide that column if the whole sum of column is zero. For that you have created a variable. But you can not use this variable for print when expression because this variable is not in main dataset.
(This is tested in jasper studio 6.2).
4) Avoid overlap of two componant
Suppose you have two componant(table) and you want to print second table companant when first prints all the data. Then set property “Postion Type” = “Float” otherwise it overlaps.
Best Open Source Business Intelligence Software Helical Insight is Here