Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Linking subreport parameters 1

Status
Not open for further replies.

smibarb

Technical User
Jun 24, 2005
40
CA
I have found other threads discussing similar topics, but cannot seem to extract the solution I need from them so here is my problem:

My main report is based on operator data. I have inserted two subreports so far, and will be adding more, that within themselves look at activity for the same operator and then count the number of items in a certain date range,based on parameters {?Start} and {?End}. The main report does not have any dates associated. The existing link between the main report and the sub-reports is operator ID.

The report works fine so far except that it prompts for four parameters; a start and end date for each of the two subreports. What I really want is to be prompted for one start date and one end date in the main report that will be used for all sub-reports.

If the solution involves editing sub-report links, please be explicit as possible in your answer. I am already linked by operator ID and I am not really understanding what each of the fields in the subreport links dialog box.

I am using v 10.0.0.533

Thank you.
 
Place the date parameter in the main report, eliminate parameters in the subreports and link the main report parameters to the date fields of the subreports during the link phase.

As you assumed, you'll need to go into the Report->Selection Formulas->Record of each subreport after you've performed the linking and change the operators to reflect >= and <= for the dates rather than the = that Crystal will default to during the linking process.

-k
 
I'm sorry, I must be overlooking something simple. I am trying to follow your instructions but...

I have created start date and end date parameter fields in the main report. I have done nothing with them in the main report other than to create them as there is no date field in the main report to select on.

I have deleted the parameters for start and end date in the sub-reports.

Then, in one of the sub-reports I try to use selection formula on the date field in the sub-report to reference the parameter in the main report. I want to use "is in between" ?Startdate and ?Enddate, but cannot see the parameters in the main report in the sub-report. If I am suppose to somehow link this through sub-report links I don't know how because I am already linked to operator ID.

Still stumped.
 
My post states:

"you'll need to go into the Report->Selection Formulas->Record of each subreport after you've performed the linking and change the operators to reflect >= and <= for the dates"

Note it says AFTER you've performed the linking. That means link the main report to the subreport, and you do so by linking the main report parameter to the date field of the subreport, and then going in and editing the operators in the record selection of the subreports.

-k
 
One comment: You can link on more than one field. Go to edit->subreport links and add each date parameter to the right. This should automatically show a subreport parameter in the lower left corner with "select data in subreport based on field" checked on the right, with the date field showing. Then when you go into the subreport record selection area, you will see something like:

{table.date} = {?pm-?StartDate} and
{table.date} = {?pm-?EndDate}

So you need to change the = to >= and <=.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top