Print Page | Close Window

Sub Reports

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Report Design
Forum Discription: The best way to design a report and problems you have encountered
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=21247
Printed Date: 05 May 2024 at 10:27am


Topic: Sub Reports
Posted By: brockloch
Subject: Sub Reports
Date 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



Replies:
Posted By: DBlank
Date Posted: 02 Jan 2015 at 5:40am
are you using crystal params? stored proc params? command params?


Posted By: brockloch
Date Posted: 02 Jan 2015 at 11:02am
Parameters created within crystal

-------------
brockloch


Posted By: DBlank
Date 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"


Posted By: brockloch
Date 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


Posted By: DBlank
Date 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)


Posted By: brockloch
Date Posted: 05 Jan 2015 at 12:08pm
right, I will try that, thanks again

-------------
brockloch



Print Page | Close Window