Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

formula field

Status
Not open for further replies.

gagani

Programmer
Nov 20, 2011
57
GB
in the front end, user has a dropdown which allows him
to select multiple products,

product
A
B
C
D
E
F
G

and there another dropdown with type1 and type2.

user can select multiple products, lets say user
selected A and B,in the code behind
i am storing it as (A,B) as string.

now i have to create a parameter field in the crystal
report, which should store that string
and if the user selects type1 in the other dropdown
then it should check in the
following table, whether any orderid has product A or B
and anything else
that is , the output is
100
101

if the user selects type2, then it should check in the
following table, whether any orderid has A and B and
nothing else
that is , the output is
100


orderid product quantity
100 A 3
100 B 2
101 B 4
101 A 3
101 C 1
101 D 8
 
So what's the question?

If you want to select two items from a single list in Crystal parameters, you'll need two separate parameters to do it.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 2008 with SQL and Windows XP [yinyang]
 
Just use Product (not your stored string) as a picklist for a parameter {?Product} and set it to allow multiple values. Then use a record selection formula like this:

{table.product} = {?Product}

Then go to report->selection formula->GROUP and enter:

(
(
{?Type}="Type2" and
distinctcount({table.product})=ubound({?Product})
) or
{?Type}="Type1"
)

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top