Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Group Scripting, help please. Post Reply Post New Topic
Author Message
bigwang916
Newbie
Newbie
Avatar

Joined: 21 May 2012
Location: United States
Online Status: Offline
Posts: 13
Quote bigwang916 Replybullet Topic: Group Scripting, help please.
     Posted: 30 Aug 2012 at 7:00am
Hi everyone!
 
I am working on a report for a imaging database. I am lost in terms on how to approach this.
 
Here is the ONLY table available from the database with data:
 
CustomerID | Name | TechID | TotalPages |         Action           | DateTime
       A01          John        ED             0            Request_Submit    08/30/2012
       A01          Jon          ED             4            Request_Submit    08/30/2012
       A01          Jon          ED             4            Process_1             08/30/2012
       A01          Jon          ED             4            Process_2             08/30/2012
       A01          Jon          ED             4            Process_Comp      08/30/2012
       A02          Dave       ED             4            Request_Submit    08/30/2012
       A02          Dave       ED             2            Process_1             08/30/2012
       A02          Dave       ED             2            Process_2             08/30/2012
       A02          Dave       ED             2            Process_Comp      08/30/2012
In this scenario, TechnicianID ED is scanning the following customer's documents. First, he submitted a request to scan John's documents. Then, he went back and had to change his name, due to typo, to Jon. He then have to submit another request which is followed by proccess and finally Process_Comp (Completed).
 
I would like my report to show that if Action=Request_Submit and followed by another Action=Request_Submit, display initial record. If Action=Request_Submit and followed by Process, show end result?

Example of what report would look like:
TechID:ED (Grouped by techID)
CustomerID | Name |  TotalPages |         Action           | DateTime
       A01          John             0            Request_Submit    08/30/2012
       A01          Jon               4            Process_Comp       08/30/2012
       A02          Dave            2            Process_Comp       08/30/2012

Is this possible?! It seems ridiculous how the DB doesn't have a transactionID field to uniquely group transactions.
 
Any help would be appreciated!
 
Thank you.
 
 
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 30 Aug 2012 at 10:06am
well, you could group by Name & TotalPages & DateTime (though if someone requested scanning to the same tech for the same number of pages on the same day, then this won't work.
 
Then suppress the group header and detail section, just display the group footer, which is the last record for each group, which should look like the example above.
 
HTH
IP IP Logged
bigwang916
Newbie
Newbie
Avatar

Joined: 21 May 2012
Location: United States
Online Status: Offline
Posts: 13
Quote bigwang916 Replybullet Posted: 30 Aug 2012 at 10:45am
Thank you. I don't think the total pages is always set. Most of the time when you see a request_submit it'll be 0 pages and Process_1 will also be 0. That was probably a bad example, the one below is what most records are displaying.
 
CustomerID | Name | TechID | TotalPages |         Action           | DateTime
       A01          John        ED             0            Request_Submit    08/30/2012
       A01          Jon          ED             0            Request_Submit    08/30/2012
       A01          Jon          ED             0            Process_1             08/30/2012
       A01          Jon          ED             4            Process_2             08/30/2012
       A01          Jon          ED             4            Process_Comp      08/30/2012
       A02          Dave       ED             0            Request_Submit    08/30/2012
       A02          Dave       ED             0            Process_1             08/30/2012
       A02          Dave       ED             2            Process_2             08/30/2012
       A02          Dave       ED             2            Process_Comp      08/30/2012
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 31 Aug 2012 at 4:26am
I was using the total pages as part of a unique grouping, but if it isn't true, I would then try just grouping on the name and the dateTime and see if that works for you.
IP IP Logged
bigwang916
Newbie
Newbie
Avatar

Joined: 21 May 2012
Location: United States
Online Status: Offline
Posts: 13
Quote bigwang916 Replybullet Posted: 04 Sep 2012 at 7:24am
I think I got it to work. I use the "Next" function to see if the next action is the same.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 04 Sep 2012 at 8:45am
just be careful.
Next doesn't care about group boundaries
IP IP Logged
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