| Author |
Message |
Beginner
Newbie
Joined: 04 Jul 2011
Online Status: Offline
Posts: 6
|

Topic: Pls guide Posted: 04 Jul 2011 at 7:18am |
|
i have a drop down with symbols,>,<.<=,>=,= . and , a text box where the user has to enter a value, so, the final outcome would be, for eg: all teh values , >(greater than) the number entered in the text box by the user. How do i achieve this?
we are using stored procedure(oracle) , passing parameters to it, but the SP becomes too huge and not an effective way. so pls suggest if there is any solution from cystal reports itself.
|
IP Logged |
|
|
|
kostya1122
Senior Member
Joined: 13 Jun 2011
Online Status: Offline
Posts: 475
|

Posted: 05 Jul 2011 at 5:58am |
|
not sure if i understood this correctly. you can create parameters in crystal its in the field explorer.(new parameter type numeric...) and put it into your main logic as (teh values(field)) > the parameter you created
|
IP Logged |
|
Keikoku
Senior Member
Joined: 01 Dec 2010
Online Status: Offline
Posts: 386
|

Posted: 05 Jul 2011 at 7:47am |
Create two parameters, the first is a list of inequality operators while the second takes a number.
Then write a record selection formula that will only get the records that satisfy the condition
Unfortunately I don't think crystal has something like "exec" in some interpreted languages so you may have to do if/else cases in your record selection formula.
if {?operator} = ">" then
{field} > {?number}
else if {?operator = "<" then
{field} < {?number}
...
You can then move those WHERE clauses out of the SP since crystal will build a query that will include the record selection. Edited by Keikoku - 05 Jul 2011 at 7:50am
|
IP Logged |
|
Beginner
Newbie
Joined: 04 Jul 2011
Online Status: Offline
Posts: 6
|

Posted: 05 Jul 2011 at 8:17am |
|
yea! Thats what i have been doin, but i am trying to find an optimal solution to it, as the procedure is becoming too huge.
|
IP Logged |
|
Keikoku
Senior Member
Joined: 01 Dec 2010
Online Status: Offline
Posts: 386
|

Posted: 05 Jul 2011 at 1:33pm |
|
I don't think it's a problem if it's too big.
|
IP Logged |
|
Beginner
Newbie
Joined: 04 Jul 2011
Online Status: Offline
Posts: 6
|

Posted: 05 Jul 2011 at 4:12pm |
|
I have to pass the {?nmber) as parameter to SP. Thats the issue. Can t same solution be used? Ie, the inequality opertaors as one parameter and the number as other, but the number alone passed as parameter to SP and following ur solution- Going to teh record select expert and writig the formula!? Possible??
|
IP Logged |
|
Keikoku
Senior Member
Joined: 01 Dec 2010
Online Status: Offline
Posts: 386
|

Posted: 06 Jul 2011 at 2:46am |
|
If you were to only pass the number as input and not the operator, then what would be the point of making a dropdown list for the operators?
Edited by Keikoku - 06 Jul 2011 at 2:47am
|
IP Logged |
|
Beginner
Newbie
Joined: 04 Jul 2011
Online Status: Offline
Posts: 6
|

Posted: 10 Jul 2011 at 12:52am |
|
well, thats t reason y i am passing the operator also as a parameter to SP nw. Anyway, i wanna kno, how to make sure the operator is selected and not left blank. IF i put- optional as false, for that parameter will the (...) that appears as the first value in the drop down defaultly, disappear??? I wanna get rid of the (...) and want jus 5 values in the drop down-- (>=,<=,>,<.=).Please suggest a way asap!
|
IP Logged |
|
Beginner
Newbie
Joined: 04 Jul 2011
Online Status: Offline
Posts: 6
|

Posted: 10 Jul 2011 at 12:58am |
|
Also, I have another query. I have a text field, where in i have to type the value. I want it to be 2 and more only. also, this text box is connected to the drop down with inequality operators. If i choose '<=' i should not be able to type 0 and 1 in the corresponding text box. Is there anyway to it!? Should it be handled in procedure only? I hope you have all understood my query! to make it clear- I have a optr parameter (which s a drop down wit inequality operators) - i have disabled custom value for that drop down.This is passed as a parameter to SP. Next i have another static field (whcih is a text boX)- the value typed in the text box is passed as another parameter to SP. When i choose,optr as - <= i should not be able to type 0 and 1. please suggest some way!!
|
IP Logged |
|
|
|