Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: SubReports Problems Post Reply Post New Topic
Author Message
davey1234
Newbie
Newbie
Avatar

Joined: 02 Jul 2009
Location: United States
Online Status: Offline
Posts: 3
Quote davey1234 Replybullet Topic: SubReports Problems
     Posted: 02 Jul 2009 at 9:27am

I am not sure if this is the appropriate site for this posting so I apologize in advance if this is the case.

I am trying to create a Crystal Reports Main report that has the following:
 
REPORT HEADER
 
and then somehow link two other reports into this main report.  I assume that using subreports is the best method for doing this.  But this does not appear to work in the way I'd like to accomplish this.
 
SubReport1 has something like 10 rows of data associated with it.  SubReport2 has something like 200 rows of data associated with it.
 
I would like ALL of subreport1 to be posted before the contents of subreport2.
 
However, instead I always seem to see a row of subreport1 then a row of subreport2, then a row of subreport1, then a row of subreport2, etc...
 
It seems to me like creating a group for each report could accomodate this behavior...but I do not seem to be able to get this to work for me.
 
Any ideas?  Examples somewhere I can look at?
 
Thanks
IP IP Logged
gurupran
Newbie
Newbie
Avatar

Joined: 25 Jun 2009
Location: India
Online Status: Offline
Posts: 6
Quote gurupran Replybullet Posted: 04 Jul 2009 at 4:36am
hi
 
 R u Link the subreports into main report?
 
Example:common fields link b/w two reports
 
Main report: Branch_code,Company_code
Sub report: Branch_code,Company_code
 
somthing like that
 
go to Edit tab choose Subreport Links. you get all the rows shows the sub reports also
 
KGR
guru
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 06 Jul 2009 at 6:17am
It sounds like you have only 1 subreport linked to the main report.
 
Crystal 'creates' a report something like this. 
a) read main report data row
b) is there a subreport?
  1) yes, print the subreport
  2) no, do nothing
c) repeat from a)
 
since the report sounds like it is interleaved, doesn't sound like 2 subreports running. if you have created 2 subreports and you can see them on the report...check the linkings like gurupran suggests.
IP IP Logged
davey1234
Newbie
Newbie
Avatar

Joined: 02 Jul 2009
Location: United States
Online Status: Offline
Posts: 3
Quote davey1234 Replybullet Posted: 06 Jul 2009 at 6:26am
I definitely do have both subreports linked to the main report.  When I open up my main report and view the data being posted.  The data is of the correct format (for each report)...however I see the data being interleaved as you suggest.
 
Is there perhaps an example somewhere I can look at of such a scenario where one has two subreports looking at different sets of data from the main report?
 
I've tried creating two groups with little success and using two subreports with the same results.  I've even tried using two separate groups and two subreports.  Same results.
 
:(
 
 
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 06 Jul 2009 at 7:25am
is each subreport in its own section?.  If the display is correct for both subreports but they are interleaved, I am confused, since a subreport cannot have a subrport and crystal processes a subreport in its entirety before doing anything else, so they shouldn't be interleaved.
 
the main report's data and the subreport should interleave.
IP IP Logged
davey1234
Newbie
Newbie
Avatar

Joined: 02 Jul 2009
Location: United States
Online Status: Offline
Posts: 3
Quote davey1234 Replybullet Posted: 06 Jul 2009 at 7:55am

As far as I am aware, each subreport is in it's own section.  I created two separate groups and places each subreport in it's own group.

Is this the correct way to do this?  Do I even need to use groups for this?
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 06 Jul 2009 at 12:18pm
still the interleaving is what is odd.  as for being in groups, one group would be called repeatedly...if sub a is in group a, and sub b is in group b, then you would call sub b for every item that is group a...could that be the cause.
 
you could try creating a second detail section, and placing a subreport in each detail section (1 per section) and see if that helps.
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