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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Linking subreport to main report using array parameter 2

Status
Not open for further replies.

geoffp

Technical User
Dec 12, 2000
6
0
0
US
In my main report I prompt the user to enter 1 or more budget groups (call this parameter
{?BudgetGroupList}). The main report lists various totals for the specified budget groups. In the report footer I have a subreport that lists totals for each budget sub-group contained in the requested budget groups.

The issue: The subreport is linked to the main report via {?BudgetGroupList}. The linked value is used in the subreport's selection criteria (like: if {budgetgroup} in {?Pm-?BudgetGroupList} )

The subreport only displays data from the first element in the array. When there are two or more values, the later elements are ignored. I have changed the selection to use the parameter as a range... Now I get all of the budget groups between and including the first and last elements in the array; so the subreport is getting the full array. I'd rather just see data for the budget groups selected by the user. Any ideas?
 
Did you try using "Multiple" with the "Discrete Values" on the parameter? This is what you want, and since the range worked as a range, this should work as an array. Ken Hamady
Crystal Reports Training and a
Quick Reference Guide to VB/Crystal
 
Thanks for the advice.
I believe the parameter is set as multiple, discrete values. The data in the main report is correct. Should I define a similar parameter (multiple, discrete values) in the subreport and then link the main report's parameter to the subreport's parameter? Currently, I'm just using the linked parameter {?Pm-?BudgetGroupList} in the selection criteria.

I'll double-check everything and let you know how it turns out.
 
Yes, you need a multiple - discreet in the subreport. That expects an array, as opposed to a range. I don't think I have ever tried linking arrays, but if the range worked I would expect the array to work. Ken Hamady
Crystal Reports Training and a
Quick Reference Guide to VB/Crystal
 
I've tried everything... but linking the main and subreport with arrays just isn't working properly. If anyone can make this work in CR7, let me know. Again, linking ranges works fine... arrays just are not processed properly. Basically, the 'in' operator treats the 1st element of the array as a string. But the formula editor recognizes the linked parameter as an array. Wierd.
 
Appears to be a bug in 7.

I tried it in 7 and only got the first value for the subreport, but got all of them in V8. Ken Hamady
Crystal Reports Training and a
Quick Reference Guide to VB/Crystal
 
You're right, it is a bug in CR7. I found a Seagate knowledge base article (C2006804) that describes a work-around to be used in version 7 and indicates that the problem is fixed in version 8. Thanks for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top