Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Group Name field not populating properly Post Reply Post New Topic
Author Message
karenb
Newbie
Newbie


Joined: 03 Oct 2007
Location: Australia
Online Status: Offline
Posts: 10
Quote karenb Replybullet Topic: Group Name field not populating properly
    Posted: 11 Aug 2016 at 3:45pm
Hi there

I am using a formula field to generate my Groups/Group Name.

The Grouping is working properly, however whichever condition I put at the beginning of the formula field, this one results in a blank Group Name.

Here is my formula:

IF "No" in ({OBJECT_csv.TouDisplayLocation}) or "No" in ({OBJECT_csv.HolderDisplayYN}) then "OBJECTS IN STORAGE" else
IF "Yes" in ({OBJECT_csv.TouDisplayLocation}) or "Yes" in ({OBJECT_csv.HolderDisplayYN}) then "OBJECTS ON DISPLAY"

In this case, the result is that the Group named "OBJECTS ON DISPLAY" shows a Group Name, but the Group named "OBJECTS IN STORAGE" does not. If I switch the formula around, then the opposite is true and it shows only the GROUP NAME "OBJECTS IN STORAGE".

Can anyone think why the Group Name is not generating properly for the first statement in my formula field?

thanks
Karen
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 12 Aug 2016 at 4:05am
firstly this is only executing for the first row of data in your group and naming your group based on that rows values. Is that what you wanted it to do?
IP IP Logged
karenb
Newbie
Newbie


Joined: 03 Oct 2007
Location: Australia
Online Status: Offline
Posts: 10
Quote karenb Replybullet Posted: 12 Aug 2016 at 8:34pm
Hi Dblank,

Across the several thousand records that will be included in the report, there is only one of two possible values that will be in the grouping field. The two available values are "Yes" or "No", so I want to group all the records according to the "Yes" (Objects on Display) or the "No" (Objects in Storage) and then in the group footer it counts (correctly) the number of records with "Yes" and the number with "No". It works as far as the generation of the group information and the counting of the records in each of the 2 resulting groups, but for some reason whichever first statement appears in the formula field, that is the group header that is blank when I generate the report... it's very strange! I've never had this happen before!
Example Data:
Total 1000 records
400 Records have the value "Yes" in the Display Location field
600 Records have the value "No" in the Display Location field.
Required output:
Objects in Storage: 600
Objects on Display: 400

Pretty simple!

It HAS just occurred to me that perhaps for some records the "holder" locations you can see in my formula in my original post are perhaps not populated with a Display Location Y/N flag... and that might be why the heading is blank! If that is the case, Ill need to change my formula with an alternative group heading for this instance, such as "No Display Information Given".... I can't check that until Monday when I'm back at work!

cheers
Karen



Edited by karenb - 12 Aug 2016 at 8:38pm
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 15 Aug 2016 at 4:25am
if you are dealing with possible NULL values in either field that you are looking at this would change the behavior.
Try changing the formula to 'use default values for nulls'
IP IP Logged
karenb
Newbie
Newbie


Joined: 03 Oct 2007
Location: Australia
Online Status: Offline
Posts: 10
Quote karenb Replybullet Posted: 15 Aug 2016 at 1:25pm
Hi there Dblank

This field is never null... all records are populated with either Yes or No (default).

Also, it doesn't seem to be related to the content of the formula... just whichever statement comes first is the one that results in a blank heading.

Very strange!

Karen
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.000 seconds.