Reputation: 389
I have a report in which I have added a sub report.In the main report,I have a field for standard score in the details section,I need to find out it's average(for which,I have used a summary field) and pass it as a parameter to the sub report where it will be linked to the sub report field - AverageScore.For achieving this,I right clicked on the sub report,selected the Change Subreport Links option and from there I linked the main report summary field to the sub report field averagescore.As a result this was the selection formula for the subreport:
{AggregateKey.AverageScore} = {?Pm-Avg of ResultSheet.StandardScore}
The preview does not show anything in the subreport.But just to try out things, when I change the linking and pass any other value as a parameter, say some other field like
{AggregateKey.AverageScore} = {?Pm-ResultSheet.TotalScore}
Or simply any other number,then I see the sub report displaying values which tells me that values are being passed.But why does that not work when I use a summary field as a parameter?
Upvotes: 0
Views: 512
Reputation: 7287
My guess is that the reason you're not getting any matching records in the subreport is because of the precision of your calculated average from the main report; the Average()
function will result in a numerical value to a certain number of decimals that may not match exactly what is in {AggregateKey.AverageScore}
.
For example, your main report has the scores in 3 records of 1, 2, and 4 which would result in the value of Average({ResultSheet.StandardScore})
being 2.33333...
which is a very difficult number to use correctly in an equality comparison without first rounding the value off in some way.
Upvotes: 1