Solved

NEXT and ONLASTRECORD Function in Crytsal Reports

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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

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…
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…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

760 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

21 Experts available now in Live!

Get 1:1 Help Now