hussainian Posted October 6, 2009 Share Posted October 6, 2009 Hi!I need some help regarding report parameters. I'm filling my report with the record from a table which has, say 10 rows. Each row has a unique id. I've added a parameter which takes this ID at run time and displays corresponding record from table. Now this is it. Using this approach, I can't see the all records of the table in this report. The thing I want is that when the prompt appears, it should have the option whether to display one record for which the parameter value has been entered OR to display all the records of the table without entring the parameter value. If I close the parameter dialog box without entering any value, the generated report is blank, which is logically correct. What am I suppoesd to do to change this behaviour. Or is there any way that I may set such default expression that pressing the Default button show me the full records.Thanks & Best Regards.AsadULLAH. Link to comment Share on other sites More sharing options...
mdahlman Posted October 6, 2009 Share Posted October 6, 2009 AsadULLAH, This exact question came up 5 days ago. The answer is here. Regards,Matt Link to comment Share on other sites More sharing options...
hussainian Posted October 7, 2009 Author Share Posted October 7, 2009 I went through that question/answer but couldn't get it. Can you please explain it w.r.t to my issue? Thanks & Best Regards. AsadULLAH. Link to comment Share on other sites More sharing options...
mdahlman Posted October 8, 2009 Share Posted October 8, 2009 AsadULLAH,It appears to me that it's exactly identical. I'm not sure what to add. Where exactly do you encouter difficulties?Regards,Matt Link to comment Share on other sites More sharing options...
hussainian Posted October 21, 2009 Author Share Posted October 21, 2009 I just restarted work on this problem. Ok let me tell yoy my problem.I've a table FUND and i want to get its FUND_CODE column. To get all fund_code, I'll write Select FUND_CODE from FUND and to get some specific fund_code through parameter, I'll write Select FUND_CODE from FUND where FUND_CODE=$P{PARAM_FUND_CODE} Now the I'll enter fund code in the parameter prompt. But if I'll want to display all the fund_code, the WHERE clause is extra. My question is how to handle this situation. How adding another Parameter will solve this issue? Thanks. AsadULLAH. Link to comment Share on other sites More sharing options...
gevattertod Posted October 21, 2009 Share Posted October 21, 2009 Hi.Try out the following ( I Dont know if this works)Create a parameter and call it for Example WhereClause from type String.Write in your query:Select FUND_CODE from FUND $P{WhereClause} $P{PARAM_FUND_CODE}leave both Parameters empty for a selection of all rows.If you want to add the where Clause, give $P{WhereClause} the value " where FUND_CODE="and $P{PARAM_FUND_CODE} the ID.Greets GevatterTod *this is a signature* Post Edited by gevattertod at 10/21/2009 11:41 Link to comment Share on other sites More sharing options...
ckampshoff Posted October 21, 2009 Share Posted October 21, 2009 Hi,I did the following to reach it. Perhaps it works for you:Select FUND_CODE from FUND where (FUND_CODE=$P{PARAM_FUND_CODE} and $P{PARAM_FUND_CODE} IS NOT null OR $P{PARAM_FUND_CODE} IS null)this works for an oracle db if you left the Parameter empty to show all entries of the table.HTHChristina Link to comment Share on other sites More sharing options...
marksanthosh Posted March 27, 2015 Share Posted March 27, 2015 I solve my problem by using the below condition in where clause.(TableName.ColumnName = NVL($P{Param},TableName.ColumnName or $P{Param} IS NULL)The above query includes even null values.If you don't want to include null values, you can just use the NVL function as shown belowTableName.ColumnName = NVL($P{Param},TableName.ColumnName) 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