How to find the first record from a group in crystal reports?

How to find the first record from a group in crystal reports?

+4
source share
5 answers

You can use the Previous function (Group_Field) in the formula to indicate the beginning of the group. An example of using the Electronic Formula function gives an example. Basically, you see if the previous value of the field you are grouping is different from the current value. If so, then you have just started a new group.

If Previous ({table.GroupingField}) = ({table.GroupingField}) Then False Else True 
+4
source

You can use: NthSmallest (1, {yourField}, {theGrouping}) Or NthLargest (1, {yourField}, {theGrouping})

Works like a charm

0
source

When the group title is printed, you are in the first entry in the group. Sometimes you can just do the work there.

0
source
  Previous ({ItemNum}) = ({ItemNum}) 

This will hide the display of the first ItemNum entry in the group and hide the rest until the next ItemNum, which is different.

0
source

To define the first subgroup in a group, you can use Previous, but this does not display the first subgroup, so use the following:

 if GroupNumber = 1 Then "This is first group in subgroup" else if Previous({Group1}) <> {Group1} Then "This is first group in subgroup" else "This is NOT the first group in subgroup" 
0
source

All Articles