Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NEXT and ONLASTRECORD issue in Crytsal reports

Status
Not open for further replies.

angel7170

Programmer
Mar 12, 2009
15
0
0
US
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
Thank you


@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
 
Try changing your if statement to this:

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}))


A computer only does what you actually told it to do - not what you thought you told it to do.
 
@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
[red](
onlastrecord or
{HPD_Search_Assignment_Logs.Incident_Number} <> next ({HPD_Search_Assignment_Logs.Incident_Number})
)[/red]
then
TotalNPC := TotalNPC + 1;

Your footer formula can just be:

//@Count NPC Resolved Footer
WhilePrintingRecords;
Global NumberVar TotalNPC;

It is also unnecessary to specify "Global" as that is the default type of variable.

-LB
 
Sorry, Hilfy, I didn't notice your post!

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top