I`m trying to do a report on JasperSoft Studio using filter expression, I have to do a report where it is possible to filter the documents generated by type, number, date and situation of the application (paied, settled and unsettled). I`ve already done for the firsts parameters and now i have to do for the situation of the application, but i dont know how to do this, because i have multiples selects from differents tables without combination.
The code that is working for the firsts parameters:
select
d.tdok typ,
d.nr numer,
d.symbmg symbol,
d.data dataDok,
d.dokumwe dokumWe,
d.datawe datawe,
d.idkntrh idKth,
d.kwotadok kwotadok,
d.kwotavat,
k.nazwa1 nazwa1,
k.nazwa2 nazwa2
from dokum0 d
join kontrahent0 k on d.idkntrh=k.idkntrh
And the nexts selects are:
select t.kwota_n kwota_n
from dokumterm t
where t.dokum_id = id_dokum;
select p.id_pozdok0 AS settledCount
from pozdok p
where p.dokum_id = id_dokum;
select p.id_pozdok0 AS posCount
from pozdok p
where p.dokum_id=id_dokum;
select t.kupspr kupspr
from sltdok t
where t.tdok=tdok;
And I have to organize by:
The document is settled if settledPosCount is equal a posCount, and it is unsettled if settledPosCount is not equal a posCount and kupspr is equal a 0.
Anyone can help me?