Solved

NEXT and ONLASTRECORD Function in Crytsal Reports

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

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. …
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…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

813 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