Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: IF Statements on a string Post Reply Post New Topic
Author Message
HSD89
Newbie
Newbie
Avatar

Joined: 27 Jul 2012
Online Status: Offline
Posts: 13
Quote HSD89 Replybullet Topic: IF Statements on a string
     Posted: 17 Nov 2014 at 6:50am
Good afternoon all!! Im hoping you can help me

Im creating a report within CR XI to create a drill down of work carried out by a member of staff. Ive done this so far by creating 3 groups (for the location, date and room/staff member) and everythings running well. The issue we have is that we have some new members of staff that have come on board, and as such theyve been teaming up as a "Panel" so they can learn on the job.

The issue with this so far is that it only shows me one member of staff for each days work. Heres an example-

If Mr adam completes a full days work, he would clear 6 points. However if theres a list of 12 points, its more than likely there were two people in that room but its only coming up with one persons name. I need to know that there was another person in that room doing the work with him so i can account for it.

I remember coming to this forum for a similar query in the past and someone recommended i make 3 formula's with the following info:-

[Formula1]- Whileprintingrecords;
Stringvar flag:=" ";


[Formula2]- Whileprintingrecords;
Stringvar flag:= flag + (if instr(Stringvar flag,{Category.Flag}) > 0 then "" else {Category.Flag} + ' ')

[Formula3]- Whileprintingrecords;
Stringvar flag;



I was told i needed to put Formula 1 and 3 in supressed groups to account for the calculations. This was useful when i was picking a series of flags up against entries. The issue i have this time around is that i dont want to make any more groups up in fear my report gets messier than it needs to be, and wanted to know if there was another way around this.

Could someone help me find the best way around this? Im sorry if ive not been great at explaining

many thanks in advance.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 17 Nov 2014 at 10:08am
you have not really explained your data set.
My guess is you are placing a your name field in a header.
This will only show the first result fromt hat field in that group.
If you were to move it to the detaikl section you would see each instance of a name.
If you did a disticnt count on that field at that group level it would tell you how many peopel are in that "group".
IP IP Logged
HSD89
Newbie
Newbie
Avatar

Joined: 27 Jul 2012
Online Status: Offline
Posts: 13
Quote HSD89 Replybullet Posted: 18 Nov 2014 at 1:26am
Hi There and thanks for your reply.

Sorry for the lack of information, you're right ive put the name as a field in the Group 3 header. Essentially i could do with knowing the names of the people in that group so i can account for it. Is there any way to do this?

kind regards
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 18 Nov 2014 at 3:28am
your sample formulas are fine but you cannot get that to display in the header only the footer.
formula 1 in the GH, formula 2 in details and formula 3 in the GF for display
 
However I have not seen any reason for display of the names, only the count of names which is why you can use a distinct count of the name field in the GH3 to get the count of staff in the group.
If you need to show the names then you can move it all to the footer or you can use a crosstab in the GH or a sub report in the GH


Edited by DBlank - 18 Nov 2014 at 3:28am
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