Print Page | Close Window

Security Swipe Card Report

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=3914
Printed Date: 19 May 2024 at 1:55pm


Topic: Security Swipe Card Report
Posted By: kiml
Subject: Security Swipe Card Report
Date 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



Replies:
Posted By: BrianBischof
Date 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 http://www.amazon.com/exec/obidos/ASIN/0974953601/bischofsystem-20 - Amazon.com or reading the http://members.crystalreportsbook.com - 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>


Posted By: kiml
Date 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



Print Page | Close Window