Selection Formula  
Author Message
.net sukbir





PostPosted: Crystal Reports for Visual Studio, Selection Formula Top

Dear All,

I have this problem of designing my report in Crystal Report. Basically my table structure is as below

ID

OutletID

Type

Serial

1

1

A

1112

2

1

B

1123

3

1

C

1200

4

2

C

1201

5

2

C

1202

Below is how I want to output my report

A 1112

B 1123

C 1200 - 1202

The problem is that for Type A and Type B I want to list as it is. But for only type C I want to put them in a range like how I did above where for 1200,1201,1202 I will just put 1200-1202. I done some reading and also did some work around building a formula as below

if {product.Type}= "A" then

else if {product.Type}= "B" then

else if {product.productType}= "C" then

I am really stuck over here. I have the idea of using an array to store all the list values and later do a test on the array value based on the product type. I really dont know how to go further. Can some pls help me I am very new to this crystal repors.

. Thanks a lot in advance.



Visual Studio4  
 
 
BeanR





PostPosted: Crystal Reports for Visual Studio, Selection Formula Top

I'm not exactly sure what your question is but you can use min and max to get the values, eg

A min 1112 max 1112
B min 1123 max 1123
C min 1200 max 1202

like i said i dont really understand what your asking or where your problem is so this might not help at all.

If you re ask your question maybe with whats happening and what u want a little clearer i'll b able to answer more effectively.

HTH
Andrew

 
 
.net sukbir





PostPosted: Crystal Reports for Visual Studio, Selection Formula Top

Dear Mr. Andrew

First of all I really wish to thank for answering me. Ok let me clarify to you. For type A and type B it will just list as it is. Thus I will list type A and type B individually. So type A and type B is not the problem it is just one to one mapping.The special case applies only for type C. Ok let me give u another example for type C

ID Type Serial
1 A 1112
2 B 1123
3 C 1200
4 C 1200
5 C 1200
6 C 1500
6 C 1500
6 C 1500
6 C 1500
6 C 1500
Ok based on the above table below is how I want to show my report.
A 1112
B 1123
C 1200 - 1202
C 1500 - 1504

Hope this time I you get me what I am trying to do. If you still dont get me pls tell me. Thanks once again Mr. Andrew


 
 
BeanR





PostPosted: Crystal Reports for Visual Studio, Selection Formula Top

OK i see, so if there is 7 1600 with C the result will be 1607,

i think you'll have to group by Type and serial and use the count feature while reading from the database,

HTH
Andrew

 
 
.net sukbir





PostPosted: Crystal Reports for Visual Studio, Selection Formula Top

Dear Andrew,

Yes I have tried both grouping first type and serial. But it is still not working. I feel I need to use a formula which where I am totally lost cause I am very new to this. Thanks for your help.