I am using iReport 4.0.2 and I want to show the result in my main report. For example, in my main report, we have two columns, and I want to get the sum of these two columns, just like this format:
AB sum 10 5 15
Where A is one field of the main report, and B is the return value of my sub-register. It works well. But the key point is that sometimes subreport does not return any value, which is a problem. In this case, the result of the sum is as follows:
AB sum 10 NULL
As we see here, B is the return value of subreport, but it does not have a value of NULL or 0. That's why we have this problem.
I am trying to find how to get the return value from a subreport when SQL returns no results. I know that iReport has the "When there is no data" property, but this does not help. So I want to know if we have another way to solve the problem in iReport or using some SQL skills.
source share