Crystal Report to detect a change in field

I have a Crystal report sorting by group and within each group I have a specific field "Type" which is a string.

For normal operations generated by the report this field will always show the same result "TAGM" but from time to time I have a violation which will be reported under "WGDC" for the same field.

I am looking for a way/formula that will indicate within each grouping when there is a change.

Your assistance would be greatly appreciated.


John-S Pretorius.
John-S PretoriusTechnical Service Manager, Mid-AtlanticAsked:
Who is Participating?
 
mlmccCommented:
Look at this report

Your WGDC is really _WGDC

You were comparing to the wrong field

mlmcc
Q-26845990.rpt
0
 
mlmccCommented:
You could use conditional formatting to highlight the record when the value is NOT TAGM

Right click the TYPE field
Click FORMAT FIELD
Click the BORDER tab
Click the formula button the the right of BACKGROUND
If CurrentFieldValue <> "TAGM" then
    crTeal

mlmcc
0
 
John-S PretoriusTechnical Service Manager, Mid-AtlanticAuthor Commented:
I actually need to be able to create a filtered report at the end, that will only show the violations under each group and not short/show any of the other transactions that have no violations.

I was thinking of using a if statement triggering the change and then sorting only the violations or changes under the same group.

Thank you for your suggestion - any other ideas?
0
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

 
mlmccCommented:
You can use the select expert to filter out and show only the non-TAGM records.
   {TypeField}  <> "TAGM"

mlmcc
0
 
John-S PretoriusTechnical Service Manager, Mid-AtlanticAuthor Commented:
I may have not been completely clear about what I'm trying to achieve, I apologize.

Each user has 2 sets of access keys, tagm or wgdc and within a cycle which typically may be entry and exit are only allowed to use one type.

I am looking for just the violations when there is a change of card type usage and don't care about the rest of the valid 'same' type records
0
 
mlmccCommented:
So if they start with TAGM you want to see the WGDC records and vice versa.

Add 2 formulas
Name - HasTAGM
If {Type} = 'TAGM' then
    1
else
    0

Name - HasWGDC
If {Type} = 'WGDC' then
    1
else
    0


You could group by user
Use group selection as
Sum({@HasTAGM,{NameField}) > 0
AND
Sum({@HasWGDC,{NameField}) > 0


In the group header add a formula
WhilePrintingRecords;
Global StringVar FirstType;
FirstType := {TypeField};
""

Conditionally suppress the detail section with
WhilePrintingRecords;
Global StringVar FirstType;
FirstType = {TypeField}

mlmcc
0
 
John-S PretoriusTechnical Service Manager, Mid-AtlanticAuthor Commented:
Just to confirm if they start the day with wgdc and it changes to the other and vice versa I want the report to group them.

This looks good so far and I will test it shortly.

Thanks for your patience, I will give you feedback in a short while.
0
 
John-S PretoriusTechnical Service Manager, Mid-AtlanticAuthor Commented:
I am getting stuck adding a Group header, as I  already had a group sorting each user.

Where do I add the indicated 'Group header' - When I run the report without the last 2 instructions I have a clear page, none of my page header or anything.

Any ideas please.
0
 
John-S PretoriusTechnical Service Manager, Mid-AtlanticAuthor Commented:
May I kindly request if you could look at the attatched file please - I'm not sure what I'm missing here. QCS-Monthly-Users-Activity.rpt
0
 
John-S PretoriusTechnical Service Manager, Mid-AtlanticAuthor Commented:
mlmcc you nailed it - that is really awesome, thank you this is certainly exactly what I was trying to do.

I will award you the points (not that al this about, surely) but I would like to keep it open for a little while longer as I may need to add a scenario where for instance if the first entrance was thru Device #52 (Broadway overhead tag - any one is alowed to start a transaction with this type TAGM and then follow thru with _WGDC as long as it stays at that)

Do you think it would be hard to add something like that ?

Thanks again, I hope we can complete the last request together.
0
 
mlmccCommented:
Probably not too tough.

You can close and then we can still continue the discussion if you wish.

mlmcc
0
 
John-S PretoriusTechnical Service Manager, Mid-AtlanticAuthor Commented:
You are the best, thank you so much -  I am going to have to follow you :)
0
 
John-S PretoriusTechnical Service Manager, Mid-AtlanticAuthor Commented:
I have so much to learn but luckily there's people like mlmcc.
0
 
John-S PretoriusTechnical Service Manager, Mid-AtlanticAuthor Commented:
Good day mlmcc, I am looking at adding another 'check' that needs to be allowed as a valid 'violation' : if the device.design = "broadway Overhead Tag" ignore that first read.

I am also looking into functionality on how to trigger a email/print  when such a violation occures. Currently I use easyview to auto generate a report every Hour and just email it out.

Is there a way to run the report and if it finfs a violation do something : email/print ?
0
 
mlmccCommented:
With the new report you should only get a report if there are violations.

Is the device.design = "broadway Overhead Tag" ever on a second or later record?

mlmcc
0
 
John-S PretoriusTechnical Service Manager, Mid-AtlanticAuthor Commented:
Unless they exit and come back in thru the same entrance. What if we just ignore that device completely ({device.design} = "Broadway overhead Tag" or it also goes by {device.number} = 52)

We are only concerned about this device - ignore it completely.
0
 
mlmccCommented:
That was what I was thinking was to add that to the record select as
    {device.number} <> 52

mlmcc
0
 
John-S PretoriusTechnical Service Manager, Mid-AtlanticAuthor Commented:
Worked perfectly...."What about triggering ?" or running a stored sql request and then emailing/printing when the violation occurs.
0
 
mlmccCommented:
Crystal cannot "trigger" anything.

Are you running this from an application?

mlmcc
0
 
John-S PretoriusTechnical Service Manager, Mid-AtlanticAuthor Commented:
Yes I'm using easyview to batch generate a bunch of reports and email them out.
0
 
John-S PretoriusTechnical Service Manager, Mid-AtlanticAuthor Commented:
The report is 100% complete now, thanks to you! You should be proud that I was able to get rid of all unwanted "numberlous" IDTag users that did not have anything asigned yet. I also changed the grouping from >0 to >2 which gives me a true violation report that Rocks.

My last Question if I may please : " How can I output at least some text if there is no violations or data to print" - currently it's just a blank page, and I would like to say maybe : "No Violationf for " {report.date} (Date)
0
 
mlmccCommented:
You can add a field to the report header or page header that says what you want

You can conditionally suppress it with

Count({SomeField}) > 0

mlmcc
0
 
John-S PretoriusTechnical Service Manager, Mid-AtlanticAuthor Commented:
No its not, it just used for a outside building reader which is only used once.
0
 
John-S PretoriusTechnical Service Manager, Mid-AtlanticAuthor Commented:
I learnt allot, thank you. when can we do the next challenge I am working on something a little more juicy defiantly worth 500 points
0
 
John-S PretoriusTechnical Service Manager, Mid-AtlanticAuthor Commented:
Please help, I'm trying to add the following to the excisting formula :

I am trying to show if a grouped  userIDTag has a duplicate movement (entry) which will show as a 0 in the system - please see image.

I am thinking that :
({ContractParkersMovement.UserIDTag},{ContractParkersMovement.MovementType}) <> 
 next ({ContractParkersMovement.UserIDTag},{ContractParkersMovement.MovementType}

should do this but keep getting a error with the formula. Violation Image
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.