Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Shared Variables Post Reply Post New Topic
Author Message
Dambuster
Newbie
Newbie
Avatar

Joined: 22 Dec 2011
Online Status: Offline
Posts: 6
Quote Dambuster Replybullet Topic: Shared Variables
    Posted: 02 Aug 2018 at 10:09pm
I hope someone can help and thanks in advance to all that read my issue - much appreciated. I'm very computer savvy (but clearly not in this particular case).

I've developed a report that when completed is saved and passed into some other software as a .rpt file with data saved therefore I have some data rules that I must obey for the software outside of Crystal. My point here is that the solution I found to the issue below isn't compatible with the 3rd party S/W.

The report prints a group as follows:

GH1 (supressed drill down ok) - {group header data} {detail data email address where a field from below = "OTH"}
Detl - some data, some data (value = "PAR")},some data { email_address}

detl - same data, some data (value = "OTH", some data { email_address}

detl - same data, some data (value = "CPT", some data { email_address}

GF1 (suppressed )

The detl line that contains "OTH" can be anywhere in an unknown number of detl lines.

My issue is that when a certain field in the detl data = "OTH" I would like to print the email address of that detail record in the group header. I can do this using a sub-report however the software this report is fed into doesn't recognise data from a sub-report. I have tried to get the data from the sub-report back to the main report using sharedvariable and whilereadingrecords but this doesn't seem to work.

I would be very grateful if someone on the forum could give me some pointers. I can work things out but if you suggest a function of feature that might work please could you show a simple example

Many many thanks in advance,

Many hands make light of the work
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 03 Aug 2018 at 3:05am
Does your detail row sort order matter?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 03 Aug 2018 at 4:31am
You can also try this
create a formula field
//EmailGHDisplay
If table.field = 'OTH' then table.email else ''
Add a group summary of the @EmailGHDisplay as a MAX
place that summary in the GH.
This assumes you only have one row per group that meets the OTH condition. If you have multiple OTH emails you need to decide how you want to resolve that 'conflict'. This will show you only one that is the max email string

Edited by DBlank - 03 Aug 2018 at 4:32am
IP IP Logged
Dambuster
Newbie
Newbie
Avatar

Joined: 22 Dec 2011
Online Status: Offline
Posts: 6
Quote Dambuster Replybullet Posted: 05 Aug 2018 at 10:22am
Apologies DBlank been away for a couple of days. No the sort order doesn't matter
Many hands make light of the work
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 06 Aug 2018 at 4:48am
Try the group solution as I think it is more likely to address instances with missing data.
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.020 seconds.