Hi all, hope you can help me.
I have several filters (parameters) in my report like gender, eye color, hair, etc.
The user can select each characteristic or left it blank. When left blank, the report should return all records.
For each filter I started to use something like:
SELECT * FROM CANDIDATES where $P{GEND} = GENDER
but this way the parameter can't be left blank. How can I change the script in order to allow blank filters to return all options?
Thanks in advance
Thanks for your reply Hozawa. I not only checked the manual like I also search the web for some hints. Right now I created a second parameter to include a "If clause" and I have this:
$P{GENDER}
To select the GENDERID (since it's a test, I'm using 1 and 2) and with Prompting
$P{ALLGENDER}
with the default expression: $P{GENDER} == null ? "GENDERID>O":"GENDERID = " + $P{GENDER}
and without prompting
In the Query Editor I use:
SELECT * FROM "CANDIDATES"
where $P!{ALLGENDER}
This works fine when I select a gender (1 or 2), but once again, if I left the parameter null I get the message "The report requires that you specify the value for some parameters before running it."
Any suggestions?
Thanks in advance