Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: Sub Reports Post Reply Post New Topic
Author Message
brockloch
Groupie
Groupie


Joined: 03 Oct 2010
Location: United Kingdom
Online Status: Offline
Posts: 76
Quote brockloch Replybullet Topic: Sub Reports
    Posted: 02 Jan 2015 at 5:19am
Hi

I hope someone can help, please.

I have to produce monthly reports based on sales, invoices, orders etc. The data is stored in separate tables and I have a couple of sub reports with the main reports so it only has to be printed once.

However I have put a parameter date range on all 3 reports which means the each date has to be entered in turn. Is there a way of entering the date once and the sub reports reading the date - although it is not the same variable.

Thanks for any help.

Ed
brockloch
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 02 Jan 2015 at 5:40am
are you using crystal params? stored proc params? command params?
IP IP Logged
brockloch
Groupie
Groupie


Joined: 03 Oct 2010
Location: United Kingdom
Online Status: Offline
Posts: 76
Quote brockloch Replybullet Posted: 02 Jan 2015 at 11:02am
Parameters created within crystal
brockloch
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 02 Jan 2015 at 11:07am
in the main report you just create one set of date params
use these to link to each subreport
that will create new params in teh sub reports that pass the values through to them
then in each subreport update your select statment to use these
e.g. "table.datefield in ?pm-start to ?pm-end"


Edited by DBlank - 02 Jan 2015 at 11:08am
IP IP Logged
brockloch
Groupie
Groupie


Joined: 03 Oct 2010
Location: United Kingdom
Online Status: Offline
Posts: 76
Quote brockloch Replybullet Posted: 03 Jan 2015 at 12:41am
Thank you very much for your help. I created one parameter to allow a range of records and this didn't work. I then created 2 parameters (as per your instructions!) and it worked great, thanks again!
brockloch
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 05 Jan 2015 at 4:54am
glad you got it.
if you prefer a single param with a range it is possible.
create the range param in the main report
in the main report create two formula fields (@start and @end) 
set them to the Min and max values of that param
@start as Minimum(?dateparam)
@end as Maximum (?dateparam)
now use the two formulas as your link to the sub reports (instead of the original param)
IP IP Logged
brockloch
Groupie
Groupie


Joined: 03 Oct 2010
Location: United Kingdom
Online Status: Offline
Posts: 76
Quote brockloch Replybullet Posted: 05 Jan 2015 at 12:08pm
right, I will try that, thanks again
brockloch
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.016 seconds.