Print Page | Close Window

Shared Variables

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=22652
Printed Date: 27 Apr 2024 at 10:53am


Topic: Shared Variables
Posted By: Dambuster
Subject: Shared Variables
Date 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



Replies:
Posted By: DBlank
Date Posted: 03 Aug 2018 at 3:05am
Does your detail row sort order matter?


Posted By: DBlank
Date 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


Posted By: Dambuster
Date 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


Posted By: DBlank
Date Posted: 06 Aug 2018 at 4:48am
Try the group solution as I think it is more likely to address instances with missing data.



Print Page | Close Window