Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Shared Varible between subgroup and main report Post Reply Post New Topic
Author Message
KSAnalyst
Newbie
Newbie
Avatar

Joined: 04 Mar 2008
Location: United States
Online Status: Offline
Posts: 29
Quote KSAnalyst Replybullet Topic: Shared Varible between subgroup and main report
     Posted: 03 Dec 2008 at 7:52am

Crystal Reports Guru's,

I have a report that is made up of two subreports and a main report.  The purpose is to extract daily services rendered by mental health professionals in a California county.  There are two types of services. 1) Direct services located in the main report (these are distinct). 2) Indirect Services located in the subreport (not distinct).  There is a shared variable between these two service types.  This then passes the total amount of indirect service time per day to the main report that then computes total time for the day.  Here is the problem.  When a mental health professional does not have any direct services, the report shows no data.  I believe the problem is due to the parameter settings in the main report that selects only "direct services" so that the indirect services don't show up in the main report.  Is there a way to compute an if, then, else statement for when the direct services are null and the indirect services are not?

 
Does this make sense?
 
I hope so,
 
Thanks
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 04 Dec 2008 at 6:20am
Since I don't know how the data is retrieved, is there a way to include a dummy row for that case? 
 
I use stored procedures and I know that I can create a row for entries that have no data so that things are complete.
 
It has been a while since I joined tables together, but you could link the tables using an outer join that would include all of the indistinct transactions with distinct ones and would create a row in the distinct that would have null values.
 
Does this make sense?  The end result is that you need an entry in the main report for the subreport to tie back to.
 
Hope this helps
IP IP Logged
KSAnalyst
Newbie
Newbie
Avatar

Joined: 04 Mar 2008
Location: United States
Online Status: Offline
Posts: 29
Quote KSAnalyst Replybullet Posted: 04 Dec 2008 at 7:15am
Thank you for your response,
 
This report links 5 tables with the first conecting with left outer joins to the others.  This report is complex and includes multiple select functions as well as multiple formulae to display the data in a consise manner. 
 
The real problem is that I am a self-taught user for Crystal since March of 08, and we have a new database and data collection system that I am trying to learn at the same time.  This might be that I just have to make two separate reports. 
 
I thought that utilizing a subreport would be a more userfriendly approach and would be more effecient.  So, I will attempt to find a way to utilize the shared variable method at this time.
 
Thanks again.
 
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