Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Security Swipe Card Report Post Reply Post New Topic
Author Message
kiml
Newbie
Newbie


Joined: 06 Aug 2008
Location: Canada
Online Status: Offline
Posts: 6
Quote kiml Replybullet Topic: Security Swipe Card Report
    Posted: 06 Aug 2008 at 8:29am
Hello
 
Could you please help me with  a report I've been asked to write.  I have never used Crystal Reports before.   I've read the manual but don't quite understand how to create 2 fields I need in the report.
 
1.  I need a column that has the difference between swipe in and out times.
 
2. I need to show a warning message if someone swiped in but didn't swipe out or the opposite, they swiped out twice.
 
 
The data in will come in like this:
 
Access Granted     In         7/25/2008  8:00
Access Granted     Out      7/25/2008 10:00
Access Granted     In        7/25/2008  12:00
Access Granted     Out      7/25/2008  16:14
 
I would like the report to to show:
 
Transaction      Scan Time     Time/Diff       Warning
IN                     8:00
OUT                 10:00             2:00
IN                    12:00            
OUT                 16:14             4:14
 
IN                    8:00                     
IN                    9:00                                    Did not swipe out
OUT                10:00              1:00
OUT                11:00                                   Did not swipe out
 
Thank You for your time
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 09 Aug 2008 at 4:43pm
If this is your first time with Crystal, this is a challenging report. Do you have experience with proramming langauges at all? That would be helpful.
 
Anyway, here is the idea you need to work on. There is a function called PreviousValue(field) that tells you what value the last record has. You can put the transaction field in this formula and find out what the last transaction was. You can compare the current transaction to the previous transaction and if they are the same, then they did not swipe in/out. Try this formula out:
if {table.transactionfield} = PreviousValue(table.transactionfield} Then
    "Did not swipe in/out"
Else
    "
this formula only displays the error message if the the previous transaction is the same as the current transaction.
 
If you need more help on formulas, chapters 5,6 and 7 of my Encyclopedia book teach all about formulas with plenty of sample code to learn from. You can find out more about my books at Amazon.com or reading the Crystal Reports eBooks online.
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
kiml
Newbie
Newbie


Joined: 06 Aug 2008
Location: Canada
Online Status: Offline
Posts: 6
Quote kiml Replybullet Posted: 13 Aug 2008 at 6:14am

I used the previous command for the error message without problem.

But I still have a bit of a problem with it for the calculation of the time difference - I want to put in a subtotal or a running total from all the calculations but it doesn't seem to allow me.
 
Can I assume that the previous command is a Pass 2 command so the subtotal or running total can no longer be used.  And that maybe I should modify the incoming data to have the in out on the same record.
 
I will have to do the same thing for a VB user interface screen (I have no experience in this either) I wonder if I could encounter the same problem getting the totals - and changing the incoming data might make this process easier as well (not expecting an answer from this because I know this is not a VB forum, its just for info)
 
Thanks for your help
Kim
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.