cancel
Showing results for 
Search instead for 
Did you mean: 

How to display the last value of a field in a group in the group header

Former Member
0 Kudos

I need to display the last quiz score from a group of quiz scores as part of the header of a group of units (the quiz score values are in the detail record). I can not use the group footer, which would be the natural place to find the last value. It must be in the group header because there will be a subsequent group within the unit group. In other words, the grouping is as follows:

Unit Group Header (Display last quiz score in unit)
SubUnit Group Header (Display other detail summaries)
Detail Record (including quiz score)
SubUnit Group Footer
Unit Group Footer

While there is a minimum/maximum summary function, there is not a first/last function.

Fuskie

Who is constantly amazed at the ability of users to request report features that are not easily implented through Crystal Reports...

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Fuskie,

If you can use the record sort expert and place the score field and use the descending order and now place the fields in group header to show the last values in group header.

Regards,

Raghavendra

Former Member
0 Kudos

Neat idea but I still need to display the subgroup and detail in the correct order.

Fuskie

Who is leaning towards creating a SQL Expression Field, but has not made one of those before...

Answers (1)

Answers (1)

patrick_genest
Advisor
Advisor
0 Kudos

Hi Fuskie,

One suggestion to display the last quiz score in the Group Header, other than what had already been suggested, will be to use a linked subreport in the Group Header. It is not an efficient way to display the information, but it could do the trick.

Another suggestion will be to insert a subreport in the report header, then store the last quiz score in an array for each group, then share it with the main report and display the values in the appropriate group. In this way it will only connect twice to the data source, one for the main report and once for the subreport, instead of multiple connection for each group.

Finally, the most efficient way will be to have this value calculated on the database side using a command object or a stored procedure.

Patrick

Former Member
0 Kudos

The subreport is the direction I was already walking towards. Thanks.

Fuskie

Who has some of the ugliest table linking in this report...