Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: subreports print several times Post Reply Post New Topic
Author Message
sandy
Groupie
Groupie


Joined: 10 Jan 2007
Location: United States
Online Status: Offline
Posts: 45
Quote sandy Replybullet Topic: subreports print several times
     Posted: 15 Jan 2008 at 11:35am
I have a report that has five subreports in detail sections Da, Db, Dc, Dd, De.
The first subreport uses a selection formula to generate a list that meets the criteria needed.  It separates the data into 2 groups. 
The 2nd subreport prints letters to send to those people listed in one of the groups (let's say group a).  The 3rd subreport prints forms to send to those people from group A.
The 4th subreport prints letters for group b data and the 5th subreport prints forms for group b data.
 
The main report as mentioned uses a selection formula.   Tthe subreports for the forms and letters are linked to 2 fields and each of those subreports have selection formulas.
Now for my problem.  It prints the report then goes on and does the letters and forms THEN AGAIN starts to print the list then letters and forms and repeats this several time. 
 
I am trying to read the information on the help files and have not figured out yet why this is doing that.  I checked to see if any of the fields in the database are linked and they are not.Cry
 
Any help would be greatly appreciated.
 
IP IP Logged
Lugh
Senior Member
Senior Member
Avatar

Joined: 14 Nov 2007
Online Status: Offline
Posts: 377
Quote Lugh Replybullet Posted: 16 Jan 2008 at 4:40am
If you put the subreports in the details section, they will print once for each record that is returned by the main report.  If you only want them to print once, move them to a header or footer section.

Another option you may want to seriously consider is to move the list subreport to the report header section, then link the forms and letters to the records in the main report.  Each form and letter subreport should return a single result.  Set suppression so that the proper form and letter are shown based on the group.  If you want all of the group A forms and letters to print first, then just group the records in the main report.

Brian's book has some good advice on placement of various elements on the report.  If you want an element to print for every record, it goes in a detail section.  If you want it to print for every group, it goes in a group header or footer.  If you want it to print just once, it goes in a report header or footer.  When figuring this, remember to think of the subreport as a whole, and how often you want it to print.


IP IP Logged
sandy
Groupie
Groupie


Joined: 10 Jan 2007
Location: United States
Online Status: Offline
Posts: 45
Quote sandy Replybullet Posted: 16 Jan 2008 at 4:50am
Much appreciated for the quick response.  I will give that a try.    Sandy
IP IP Logged
sandy
Groupie
Groupie


Joined: 10 Jan 2007
Location: United States
Online Status: Offline
Posts: 45
Quote sandy Replybullet Posted: 16 Jan 2008 at 7:49am
Thanks Lugh, it worked.  I think I am having a hard time understanding subreports.  I now want to print labels for the addresses that print on the 2 different letters.  (Take the name and address from each letter and print labels for them) Both letters use a different formula to arrive at the address to print on the letter.   Do I want to link the subreport (the labels) to the letter subreport (can you even link to a subreport and not the main report) or do I want to use a formula in the select expert to select the name and address from the letter subreport?  
Also when I inserted the label.rpt as my subreport the 3rd column of address is extending beyond the canvas of the report and it was not that way in the label.rpt that I am inserting thus I am not all the labels.
Much appreciated as always!
 
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