Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Keeping records on a single line Post Reply Post New Topic
Author Message
MikeC
Newbie
Newbie


Joined: 10 Jun 2008
Online Status: Offline
Posts: 17
Quote MikeC Replybullet Topic: Keeping records on a single line
     Posted: 31 Jul 2008 at 2:27pm
I'm working on a pay history report and having some difficulty with a sub report.  The report lists pay history by check of each employee and the sub report lists all of the Benefits, Deductions and Contributions on a paycheck.
 
My data looks like this:
 
Check_No   Emp_ID   Type   Amount   Bended_code   Base_Amt
1000                1          C       262.29       aetna                0.00
1000                1          C         27.00        dpt                   0.00
1000                1          B           8.75         life                    0.00
1000                1          D          77.43         ss                  1248.92
1000                1          B          77.43         ss                  1248.92
1001                3          C        263.25       aetna                0.00
1001                3          C          15.00         dpt                   0.00
1001                3          B           77.43          ss                 1248.92
1001                3          D           77.43          ss                 1248.92
 
It's linked to my main report by check number and what I get is this:
 
Check
1000
 
Code      Ben        Ded          Cont       Base_Amt
aetna     0.00     0.00         262.29         0.00
dpt         0.00     0.00           27.00         0.00
life          8.75    0.00             0.00         0.00
ss           0.00    77.43           0.00       1248.92
ss           77.43    0.00           0.00       1248.92
---------------------------------------------------------------
 
Check
1001
 
Code      Ben        Ded          Cont       Base_Amt
aetna     0.00    0.00         263.25         0.00
dpt         0.00    0.00           15.00         0.00
ss           0.00    77.43          0.00       1248.92
ss           77.43   0.00           0.00       1248.92
 
Lines with both a B (benefit) and D (contribution) for the same ben/ded/cont code are on separate lines.  I'd like to combine it onto a single line like this:
 
Check
1000
 
Code      Ben        Ded          Cont       Base_Amt
aetna     0.00    0.00         262.29         0.00
dpt         0.00    0.00           27.00         0.00
life          8.75    0.00             0.00         0.00
ss          77.43    77.43           0.00       1248.92
 
---------------------------------------------------------------
 
Check
1001
 
Code      Ben        Ded          Cont       Base_Amt
aetna     0.00    0.00         263.25         0.00
dpt         0.00    0.00           15.00         0.00
ss          77.43    77.43           0.00       1248.92
 
 
If anyone can offer any pointers, suggestions or ideas to format this on a single line I'd really appreciate it.  The data is in SQL and I can create views if it works better.
 
Thanks!
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 31 Jul 2008 at 5:04pm
I suggest creating a formula which combines the fields into a common value. That will allow you to group on them (and summmarize the values into a single line). Something like this:
if {yourtable.Type}=='B' OR {yourtable.Type} =='D' Then 
   "BD"
else
    {yourtable.Type}
I have lots of tips and tricks just like this one in Chapter 6 and 7 of my Encyclopedia book. You can find out more about my books at Amazon.com or reading the Crystal Reports eBooks online.


Edited by BrianBischof - 31 Jul 2008 at 5:04pm
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
MikeC
Newbie
Newbie


Joined: 10 Jun 2008
Online Status: Offline
Posts: 17
Quote MikeC Replybullet Posted: 01 Aug 2008 at 6:01am

Please forgive my thick headedness-I've read both chapters in the book but I'm still struggling with this.

Could you give me a bit more detail?  I've tried the formula and I return "BD" or "C", but I don't understand how to return the values where I need them.  There must be a piece that I'm just not getting.
 
Remember-I'm a raw newbie at Crystal Confused
 
Thanks!
 
 
IP IP Logged
MikeC
Newbie
Newbie


Joined: 10 Jun 2008
Online Status: Offline
Posts: 17
Quote MikeC Replybullet Posted: 01 Aug 2008 at 6:58am
Looks like I might be able to make a cross tab sub report work.  I'll try it from that angle and let you know.
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