Home » Developer & Programmer » Reports & Discoverer » Passing Parameters from Reports for a dynamic condition
Passing Parameters from Reports for a dynamic condition [message #88026] Tue, 15 January 2002 09:16 Go to next message
Raj
Messages: 411
Registered: November 1998
Senior Member
Hi

I need to develop a report from a parameter form which looks like this..

UserName : (Textbox here)
Hours : (Textbox here)
Project : (Textbox here)

If the username is entered, and if we hit the enter button, the number of hours that were worked by that user on different projects should be displayed. Similarly, say if we enter 4 for hours, we should get all the usernames who have worked for 4 hrs on any projects. Similarly, if we give a project name in the textbox, all the usernames who have worked on that particular project should come out with the number of hours. I hope you understand that more combinations are available here. I dont understand how to create such a report as this is based on an If-Else condition.

Is there a way to create a report based on such conditions like this.

Your help is badly needed at this point of time, I appreciate sincerely for any efforts from you to help me out.
Thanks a lot
Raj
Re: Passing Parameters from Reports for a dynamic condition [message #88033 is a reply to message #88026] Fri, 18 January 2002 20:23 Go to previous messageGo to next message
vinod srinivasan
Messages: 7
Registered: October 2001
Junior Member
Hi,
It is possible . Bbut in a very complicated way.
1) create a parameter form
USer name :
Hours :
Project :
2)Create a lexical referenc e varaible which contain where conditions based on parameter form value
3) Pass the lexical reference to the data model and run the report .

I hope this would help you in solving your problems.
Regards,
vinod
Re: Passing Parameters from Reports for a dynamic condition [message #88081 is a reply to message #88026] Wed, 13 February 2002 03:59 Go to previous message
paul Dal Bianco
Messages: 4
Registered: February 2002
Junior Member
Use the after_parameter_form trigger top add conditional logic to build the where clause of your query.

Create a parameter like :WHERE_CLAUSE and add conditions to it based on the parameters the user entered.

if :username is not null then
:where_clause := ' and username = ''' || :username || '''';
end if;

if :hours is not null then
:where_clause := :where_clause || ' and hours > '|| to_char(:hours) ;
end if;

etc...

Now use the :where_clause as a lexical reference in select statement within the report data model.

select username, hours
from user hours
where dept = 1
&where_clause
order by username
Previous Topic: How to adjust column in a Matrix Report.
Next Topic: Matrix Report , master and detail tables
Goto Forum:
  


Current Time: Fri Mar 29 10:14:04 CDT 2024