Problem with Scope parameter for SUM function
Scope names have to be string constants.
I'm not sure why you need dynamic scopes, but you can simulate them.
Assuming you have a function that returns a number between 1 and N, use an
expression similar to this:
=Choose( Code.DetermineScope(), Sum(Fields!F1.Value), Sum(Fields!F1.Value,
"Group1"), Sum(Fields!F1.Value, "Group2"), ........, Sum(Fields!F1.Value,
"DataRegionName"), Sum(Fields!F1.Value, "DataSetName") )
Notes:
* you can only use scope names of containing groups, and data regions (e.g.
table, list, matrix)
* for huge reports (i.e. with many data rows in the dataset) this approach
of simulating dynamic scopes will degrade performance
* do***entation on the Choose function is available at:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vblr7/html/vafctchoose.asp
--
This posting is provided "AS IS" with no warranties, and confers no rights.
|