user1912935
user1912935

Reputation: 381

combine rows of table into one row in crystal reports

I have table like below

City       Area   Fruit     Price    As On  
XXX        111X   A         10       01-Oct-14  
XXX        111X   A         15       02-Oct-14   
XXX        111X   B         10       01-Oct-14  
XXX        111X   B         20       02-Oct-14  
.....  

This data i need in Crystal reports in below format

XXX  
A  
City       Area   Fruit    01-Oct-14    02-Oct-14  
XXX        111X   A        10           15

B
City       Area   Fruit    01-Oct-14    02-Oct-14  
XXX        111X   B        10           20

I tried in many ways to group the data but not getting desired result i dont want to use the cross tab Please help me out on this..

Upvotes: 0

Views: 1765

Answers (1)

Siva
Siva

Reputation: 9101

For this kind of requirement:

  1. Group by Fruit first.

Then place the City, Area and Fruit in detail section

  1. For dates use Crosstab take the cross tab exactly after Area and take date in the crosstab.

Edit...................................................

if crosstab shouldn't be used then write below

create 2 formulas:

  1. `@Firstdate'

    if As On='01-Oct-14'
    then price
    
  2. `@seconddate'

    if As On='02-Oct-14'
    then price
    

place both formulas after Fruit in detail section

Hi Siva it is displaying i tried with above formula bu i got below



XXX
A
City Area Fruit 01-Oct-14 02-Oct-14
XXX 111X A 10 0 XXX 111X A 0 15 B City Area Fruit 01-Oct-14 02-Oct-14
XXX 111X B 10 0 XXX 111X B 0 20

Upvotes: 1

Related Questions