Solved

NEXT and ONLASTRECORD Function in Crytsal Reports

Posted on 2009-04-10
3
5,330 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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

730 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