Solved

NEXT and ONLASTRECORD Function in Crytsal Reports

Posted on 2009-04-10
3
5,113 Views
Last Modified: 2012-05-06
Hello,
I am using the formulas to do a count based on the condition below. The issue is on the last record, if the condition is true, it displays nothing on the detail section and at the group footer it doesn't count the last record. I undersatand it is  because I am using "Next" in my formula. What should I do get the last record counted when the condition is true. please assist

@Count NPC Resolved
 

WhilePrintingRecords;

Global NumberVar TotalNPC;
 

if {HPD_Search_Assignment_Logs.Assigned_Group} = "NPC" 

and {HPD_Search_Assignment_Logs.Status} in ["Resolved", "Closed"] and

{HPD_Search_Assignment_Logs.Incident_Number} <> next ({HPD_Search_Assignment_Logs.Incident_Number})

then 

(

   TotalNPC := TotalNPC + 1;

 TotalNPC

)
 
 

@ Count NPC Resolved Reset

WhilePrintingRecords;

Global NumberVar TotalNPC:= 0;
 
 

@Count NPC Resolved Footer

WhilePrintingRecords;

Global NumberVar TotalNPC;

If TotalNPC = 0 then

   0

else

   TotalNPC

Open in new window

0
Comment
Question by:angel7170
3 Comments
 
LVL 77

Expert Comment

by:peter57r
ID: 24116292
I assume we are talking about...
"TotalNPC := TotalNPC + 1;"

Are you saying that you will always want to count the last record or are there still conditions that must apply?
0
 
LVL 100

Accepted Solution

by:
mlmcc earned 125 total points
ID: 24116463
Try it this way

 
if {HPD_Search_Assignment_Logs.Assigned_Group} = "NPC"
and {HPD_Search_Assignment_Logs.Status} in ["Resolved", "Closed"] and
(OnLastRecord OR
{HPD_Search_Assignment_Logs.Incident_Number} <> next ({HPD_Search_Assignment_Logs.Incident_Number})
)

mlmcc
0
 

Author Comment

by:angel7170
ID: 24118316
Thank you mlmcc. It worked.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Grand Totals on Crystal Reports 7 38
Crystal Reports Subreport details 16 50
Crystal Formula to "conditionally count/sum" 3 39
Visual Studio .Net 2012 and Crystal Reports 9 45
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Need to grow your business through quality cloud solutions? With everything required to build a cloud platform and solution, you may feel like the distance between you and the cloud is quite long. Help is here. Spend some time learning about the Con…
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now