Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: sub reports Post Reply Post New Topic
Author Message
jschill2628
Newbie
Newbie


Joined: 24 Oct 2013
Online Status: Offline
Posts: 2
Quote jschill2628 Replybullet Topic: sub reports
     Posted: 28 Oct 2013 at 9:20am
I have a code dependency. for example when selected A I get 1,2,3. when B: 4,5,6. I think my issue lies when I make this into a sub report. the sub report no longer is bringing all the values across for example when selecting A I get 1, or they are coming across as duplicative. for example when I select A I get 1,2,3,1,2,3. Or they come across as duplicative and out of place: when selecting A, I get 1,4,2,5,6,3

Can anyone help me with this. I believe it has something to do with how the report and sub report are linked.
Thanks In advance!
IP IP Logged
Sastry
Moderator
Moderator
Avatar

Joined: 16 Jul 2012
Online Status: Offline
Posts: 537
Quote Sastry Replybullet Posted: 29 Oct 2013 at 12:18am
Yes, you are right. This is just because there is no proper link and filter between your main and sub report.
 
Do the following :
 
--Right click on sub report and go in change sub report links and link your sub report with a formula/code dependency object (i.e. A, B etc..)
 
Now go in sub report and go in record selection formula and give a condition like
 
if {@formula} ='A' then database.field in [1,2,3]
else
if {@formula} ='B' then database.field in [4,5,6]
 
 
Thanks,
Sastry
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 29 Oct 2013 at 4:48am
I am not sure that Sastry's solution is correct. I believe he is correct in that the subreport needs to be linked correctly.

I am not sure about the formula part...if the selection criteria from when it was a 'Main' report is the same as the when it is a 'SubReport' I would suspect that the parameters are not being 'passed' or 'linked' correctly.

Each of the values in the main report that determine the values in the subreport should be linked so that both reports (main and sub) are in unison.

Hope this makes sense
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