robert_mx7 Posted August 27, 2008 Share Posted August 27, 2008 HiI want to pass null report parameters to a report created in ireport, and for the report to still run. Reason: Adempiere users are used to entering blank date ranges for unused parameters like say account date, and just entering the parameters they want - date created, invoice date etc.I found this simple solution failed for me in Edit -> Report query. Is it a bug?select * from <any table of your choice>where ( (<some date field> >= $P{param1}) or ($P{param1} is null) )param1 is also of type date, and I expect (but don't find) that the report should still generate output even when I select "use default" on the parameter pop up. All I get though is "the document has no pages"Maybe param1 is not null? but if you change the query toselect * from <any table of your choice>where ( (<some date field> >= $P{param1}) or ($P{param1} is not null) )then I find the report still produces no output. Choose a parameter value, and it does. Link to comment Share on other sites More sharing options...
hangman01 Posted August 29, 2008 Share Posted August 29, 2008 Try:select * from <any table of your choice>where <some date field> >= nvl($P{param1},<some date field> )I have done this on reports where I needed to produce one report by an ID or the entire batch at one time. Hope that this helps. 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