views:

475

answers:

3

Hi,

I have a report with the 4 columns,

       ColumnA|ColumnB|ColumnC|ColumnD
Row1      A1     B1      C1       D1        
Row2      A1     B1      C1       D2        
Row3      A1     B1      C1       D1       
Row4      A1     B1      C1       D2       
Row5      A1     B1      C1       D1

I did like grouping based on the 4 columns, but i got output with space for every row.

But here in this report i would like to get the ouput as,

       ColumnA|ColumnB|ColumnC|ColumnD
Row1      A1     B1      C1       D1        
Row2      A1     B1      C1       D2        
<-------------an empty space ----------->
Row3      A1     B1      C1       D1       
Row4      A1     B1      C1       D2       
<-------------an empty space ----------->
Row5      A1     B1      C1       D1

How can i achieve the above output?

A: 

A standard group by would sort the record like this:

       ColumnA|ColumnB|ColumnC|ColumnD
Row1      A1     B1      C1       D1        
Row3      A1     B1      C1       D1       
Row5      A1     B1      C1       D1
Row2      A1     B1      C1       D2        
Row4      A1     B1      C1       D2

Since you don't have a standard grouping, another approach may work. You basically want a blank line after the D2 value. This will only work if you always have D2 values at the end of a group.

Create a new blank detail section under the main section

Detail one
    A1     B1      C1       D1 
Detail two 
  <blank>

Then put a conditional suppress expression on detail two

ColumnD <> "D2"

Then whenever D2 is present the blank detail section will be displayed.

DJ
Hi Dj, thanks for the info! but i need the output in such the way i specified, like the value should be grouped based on the value in Column D as D1, D2 and another group with D1, D2 and at last the D1 should be grouped alone. Will it be possible to implement it?
See edit - it may need some tweaking depending on your data but the general concept should work
DJ
A: 

Hi,

I have a report with the 4 columns,

The SQL query returns the following rows,

   **ColumnA|ColumnB|ColumnC|ColumnD**

Row1 A1 B1 C1 D1

Row2 A1 B1 C1 D1

Row3 A1 B1 C1 D2

Row4 A1 B1 C1 D2

Row5 A1 B1 C1 D3

Row6 A1 B1 C1 D4

Row7 A1 B1 C1 D5

Row8 A1 B1 C2 D6

Row9 A1 B1 C2 D6

I need to group the above rows in such a way that the result will like below

   **ColumnA   |ColumnB   |ColumnC   |ColumnD**

Row1 A1 B1 C1 D1

Row2 A1 B1 C1 D1

<-------------an empty space ----------->

Row3 A1 B1 C1 D2

Row4 A1 B1 C1 D2

<-------------an empty space ----------- >

Row5 A1 B1 C1 D3

Row6 A1 B1 C1 D4

Row7 A1 B1 C1 D5

<-------------an empty space ----------->

Row8 A1 B1 C2 D6

Row9 A1 B1 C2 D6

<-------------an empty space ----------->

Will it be possible in the Crystal Report?

Please help me?

vel
A: 

You can use a Formula instead of a field Value for grouping.

select Column4 <br>
case D1 : "Group1"<br>
  case D2 : "Group2"<br>
  case D3 : "Group3"<br>
  case D4 : "Group3"<br>
  case D5 : "Group3"<br>
  case D6 : "Group4"<br>
default "Group5"<br>

Is that your problem ?

The blank lines can be generated as Group Footer.

TDuemesnil