Jump to content

Pass Null Parameters to ireport


robert_mx7

Recommended Posts

Hi

I 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 to

select * 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

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...