Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Sub-subreport workaround? Post Reply Post New Topic
Author Message
dr_abrock
Newbie
Newbie


Joined: 13 Sep 2007
Online Status: Offline
Posts: 4
Quote dr_abrock Replybullet Topic: Sub-subreport workaround?
    Posted: 13 Sep 2007 at 10:35am
Hi All,
 
I'm working on a report in Crystal XI for which I seem to need sub-subreports, though it seems they aren't supported.  So, let me explain the situation (hopefully someone has a fucntional workaround for the issue):
 
The data I'm using comes from an MS Access file (actually an export from Raiser's Edge), with a table format that looks something like this:
 
Donors (primary records)
Solicitors (linked to Donors, many-to-one)
Actions (linked to Donors, many-to-one)
Notes (linked to Actions, many-to-one)
 
My report is grouped primarily by Donor ID.  For each donor, I want to output information for all related Solicitors--I'm using a subreport here, and it works great.  I then want to show all actions for each donor, but I want them split into two groups by date (first group = past 7 days, second group = next 30 days).  I had accomplished this by creating two subreports for actions, and using the Select Expert for each of those two subreports to pick the appropriate action dates to include.
 
Each action may have 0, 1, or more than 1 note associated with it.  I want to list the action information and all notes associated with each action--unless there are no associated notes, in which case I just want to list the action information.  I accomplished this by grouping each of the two Actions subreports by Action ID, putting the action information in the group header, and putting the associated note information in the detail section.
 
This works fine if there are one or more notes associated with an action.  HOWEVER, if there are no notes associated with the action, there is no information in the detail section, and the action is omitted from the subreport.  If I could create a sub-subreport for each action to display the notes, I could prevent this.  But since I can't, I'm stuck.
 
Any thoughts?
IP IP Logged
p&ccrystal
Newbie
Newbie
Avatar

Joined: 06 Sep 2007
Location: United States
Online Status: Offline
Posts: 18
Quote p&ccrystal Replybullet Posted: 13 Sep 2007 at 1:48pm
I would not even use a subreport. I would make Donors the 1st group, then Solicitors, then Actions, then Notes the last group. The Note content  would be the Detail Section. That would make a very simple report with all actions showing regardless of whether a note exists for that action. That is a simple quick report which only leaves out the two date groups.
 
If you really need the actions broken down into two groups you might use a subreport for the last 7 days and another subreport for next 30 days. 
 
Hope this works for you.
10 year user of Crystal Reports - recently implemented Crystal Server 11.5
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 13 Sep 2007 at 2:10pm
p&ccrystal, I think you're only part right.  Here's what I would do...
 
- In the main report, group by Donor ID and link to the Actions table and from Actions to Notes.  Make these links "Left Outer Join"s by right-clicking on the link and selecting "Link Options" and changing the selection under "Join Type".  This will get you your data even if there are no notes for an action or solicitors for the donor.
 
- Put the Solicitors in a subreport and place it in a Donor ID group header section.
 
- Group on whatever field in the Action table that you want to sort on.  Put the action data in the group header.
 
- Put the notes in the Details section.
 
- If you want the Action data to appear on the same line as the first note, turn on "Underlay Following" for the Action group header and make sure that your fields in the header and details line up correctly so that nothing gets overwritten.
 
-Dell
IP IP Logged
jkwrpc
Senior Member
Senior Member


Joined: 19 Jun 2007
Location: United States
Online Status: Offline
Posts: 432
Quote jkwrpc Replybullet Posted: 13 Sep 2007 at 3:13pm

There are probably several way to resolve the problem without using a subreport.  I will suggest the following, but it may still need some tweaking to get it correct. This is all premised on the concept that DonorId links the fields.

GroupHdr1a -  DonorID
GroupHdr 1b - SolicitorID
Detail a Action  - Currentdate - 7 days
Detail b Action  - between Currentdate - and CurrentDate plus 30 days
 
 
You do this by  creating Three Command Query objects one for each of the date ranges, plus a main query that has the donor information. Group you query in the query by Donor, Solictor. That should give you every solicitor for a particular donor.
 
Be sure to Left Outer Join to the third  but MasterCommand Object which has the Donor and Donor ID. Use the Donor ID to link the the 3 Command Objects.
 
If  I am close you should get what you want without any subreports. Others can probably improve upon it.
 
Hope this helps.
 
Regards,
 
John W.
 
IP IP Logged
dr_abrock
Newbie
Newbie


Joined: 13 Sep 2007
Online Status: Offline
Posts: 4
Quote dr_abrock Replybullet Posted: 13 Sep 2007 at 5:16pm
Thank you all for your help!  It seems the most crucial component that I was missing was changing the links between the Actions and Notes tables to type = Left Outer Join.  I am continuing to use subreports for the two action groups only because I've already created it as such, and it works.  Thanks again!
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.035 seconds.