I have a report that sums the instances of three conditions. On the last record in the report, CR shows the value as null, enen though there is an instance that it should count.
As a result the sum of the instances is off by one.
What are the conditions? Does one rely on the NEXT() function? Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
Here's my formula - works perfectly except for on the last record of the report. If I unsuppress this field, and the last record has a POS TYPE of "New", the field passes a null value.
WhilePrintingRecords;
NumberVar New;
if {MWH_ORR.POS TYPE}='New' and {MWH_ORR.REQ NUMBER} <> next({MWH_ORR.REQ NUMBER}) then
New:=New+1
else New:=New+0;
WhilePrintingRecords;
NumberVar New;
if {MWH_ORR.POS TYPE}='New' and {MWH_ORR.REQ NUMBER} <> next({MWH_ORR.REQ NUMBER}) then
New:=New+1
else New:=New+0;
********************************
The reason that it is failing on the last record is that you are looking "forward" to the "next" value which is null on the last record. Since it is null this complete formula will fail on the last record.
to fix it try this
WhilePrintingRecords;
NumberVar New;
if (NextIsNull({MWH_ORR.REQ NUMBER}) and {MWH_ORR.POS TYPE}
='New') OR ({MWH_ORR.REQ NUMBER} <> next
({MWH_ORR.REQ NUMBER}) and {MWH_ORR.POS TYPE}
='New') then
New:=New+1
else
New:=New+0;
If OnLastRecord... Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.