crystal-reportscrystal-reports-2008crystal-reports-2010

I want to draw border in Crystal Report with formula


I want to draw bottom border at the end of each set of the rows. I did it using following formula:

If {spAcc_AdvertisingOSTransferToNAgentReport;1.Advertiser} = Next({spAcc_AdvertisingOSTransferToNAgentReport;1.Advertiser}) Then
    crNoLine
Else If {spAcc_AdvertisingOSTransferToNAgentReport;1.Advertiser} <> Next({spAcc_AdvertisingOSTransferToNAgentReport;1.Advertiser}) Or OnLastRecord Then
    crSingleLine

This formula works perfectly. But the last record didn't draw a border, even if I use:

OnLastRecord

How can I solve my problem?


Solution

  • Your expression chokes on the Next condition when there is no Next. So change it to:

    If OnLastRecord Then crSingleLine
    Else If {spAcc_AdvertisingOSTransferToNAgentReport;1.Advertiser} = Next({spAcc_AdvertisingOSTransferToNAgentReport;1.Advertiser}) Then
        crNoLine
    Else crSingleLine