maria.pereira Posted September 26, 2016 Share Posted September 26, 2016 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? Link to comment Share on other sites More sharing options...
Solution manshack_one Posted September 26, 2016 Solution Share Posted September 26, 2016 With JasperReports you only get to run one query per report. Exceptions to that would be subreport elements or writing the selects in code and adding a bean to the report to run it. I generally find it's easier to build my query using a query editor outside of JasperStudio and view my results there. Once I know I can build one query to pull everything together into one large dataset then I'll move it to JasperStudio and copy the query in. Then you can decide what you're going to filter on or group. Hopefully that makes sense. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now