Wednesday, May 30, 2012 8:28 PM
I need to create a Stacked Column Chart with data from SharePoint 2010. What is the best way to get counts from the SP list grouped on one value?
I have tried using separate datasets and the LookUpSet function, but I get errors trying to get the count. I also tried using LookUpSet().length but it is not recognized in the Series Properties expressions. Is there another way to get the count from the array brought back from the LookUpSet function?
Sunday, June 03, 2012 6:24 PMModerator
To count the values in an array item returned by the Lookupset function, we can use a custom code. The following steps are for your reference:
- On the report Design surface, open the Report Properties window and click the Code tab.
- Copy the following function into the code box:
Function CountItems(varArray as array) as integer
Dim RetVal as integer
RetVal = ubound(varArray) + 1
- Set the target expression like below:
Using Custom Code References in Expressions
If you have any questions, please feel free to let me know.
- Proposed As Answer by Syed Qazafi AnjumMicrosoft Community Contributor, Moderator Monday, June 04, 2012 1:56 AM
- Marked As Answer by Mike YinMicrosoft Contingent Staff, Moderator Thursday, June 07, 2012 3:48 PM
Monday, June 18, 2012 2:13 PM
For some reason I did not get any notice that you had responded to this. I eventually did this by having an immediate if inside a sum for each series property similar to the following:
Thank you for your reply!
- Marked As Answer by Mike YinMicrosoft Contingent Staff, Moderator Tuesday, June 19, 2012 1:08 AM
Tuesday, June 19, 2012 1:08 AMModerator
Thanks for your posting and feedback.
I am glad to hear that you have got the issue resolved. Thank you for sharing your solution. Hope this thread will help more people who face with the same issue.