Search code examples
crystal-reports

Can a detail section be made to behave as a footer?


I am updating a Crystal Report (with version 2016 of the designer) and have been stuck on trying to make a details section behave as a footer. The block of code we are modifying currently consists of two sections, one a 'header' that prints once (through suppression code) and a repeating detail line which prints from one to five times.

What we'd like to do is add a third section prints just once, after the last repeating detail. Is there a way to ensure this third section not only prints just once but prints after the first and second sections have printed? Or must we use a group or subreport?


Solution

  • Yes, it can serve as a footer, by using a Suppress formula to find the last row in the sequence. In this case, this was done by checking for the condition where the current datasource record is of the target row-type and the next is not.

    IF ({DS.RECTYPE} = 4 AND NEXT({DS.RECTYPE}) <> 4) THEN
        FALSE
    ELSE
        TRUE