Crystal Report: Is PreviousNull prints incorrect d

2019-09-04 08:56发布

问题:

Some days back i posted a question in SO at Crystal Report: Display 0.00 for duplicate values

The question was to remove duplicate values and the report should display 0.00 instead. It was very kind of @adatapost that he posted a solution.

Now,it is throwing very irritating and awkward problem.

The 7th record is showing up 0.00

Hence, if the record was like before as

400.00
400.00
400.00
500.00
500.00
500.00
600.00
600.00
600.00

After that formula applied is showing something like

400.00
0.00
0.00
500.00
0.00
0.00
0.00 (THIS IS INCORRECT-- IT SHOULD BE 600.00)
0.00
0.00

Can you please throw some light in this issue? I appreciate your inputs & efforts.

thanks!

回答1:

Create a formula named 'Amount'.

Add the following to the formula:

If PreviousIsNull ({table.field}) Or Previous ({table.field}) <> {table.field} Then
    {table.field}
Else
    0

Use this formula instead of the database field.