Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Grouping Post Reply Post New Topic
Author Message
immad
Newbie
Newbie


Joined: 05 Jun 2013
Location: Pakistan
Online Status: Offline
Posts: 25
Quote immad Replybullet Topic: Grouping
     Posted: 08 Nov 2013 at 1:18am
hello

i a have a problem regarding grouping

i want to make a group wise report in crystal report

can any tell me how to make a multiple group one is date and another is employee id

thanks for the help
immad
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 08 Nov 2013 at 4:28am
you mean you want the user to select the grouping type at run time?
 
create a formula to use each item based on the selection of the parameter and then group on that formual field.
YOu will have to be cautious about how you do that  to make sure you sort and keep the date togther as you will have to alter it to a number or a string to work with the emplyee id
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 08 Nov 2013 at 4:44am
following up on DBlank's suggestion, I would go with making it a string, just because you have more control...and for the date I would format it as a date...drop the time portion, which will make the for fewer groups, which I am guessing is the intent

HTH
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 08 Nov 2013 at 4:52am
the tricks though are to make the string sort by date and group correctly. I would normaly go with the string too but I was thinking that a datediff resulting in a numeric value might be easier for both of those issues as well as match the staff id type assuming it is numeric.
using a datediff('desired interval',date(1900,1,1),{table.datefield}) should result with a proper grouping as well as easy sorting ascending or descending. Youl would need a different display but that is easily handled in a number of ways.
Just a thought...
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 08 Nov 2013 at 4:55am
well...
you could transform the date to "yyyyMMdd"...then the date will always sort correctly.

And grouping vs display can and usually is different when you are concatenating fields.

Regardless, it is a good point
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