Search code examples
sharepointssasperformancepoint

How to read scorecard items programmatically?


I managed to get the scorecard item using the BIMonitoringAuthoringServiceProxy webservice, but I have no idea how can i go through the items that it holds (am unsure of the terminology that should be used for the items that are shown in the scorecard).

I need to read these values and draw them on a bing map, so i need to iterate through the items.

I couldn't find any references online. So any help guys?


Solution

  • If you haven't seen this, this topic describes the high-level scorecard architecture -- http://msdn.microsoft.com/en-us/library/ee557351.aspx

    Not sure if this will help with what you are trying to do, but this is a sample of looping through a scorecard object that is used by scorecard transforms: (http://msdn.microsoft.com/en-us/library/bb833673.aspx)

    // Get the headers under the root row header.
    List<GridHeaderItem> nonLeafRowHeaders = viewData.RootRowHeader.GetAllHeadersInTree();
    
    // Get the leaf headers under the root column header.
    List<GridHeaderItem> leafColumnHeaders = viewData.RootColumnHeader.GetAllLeafHeadersInTree();
    
    foreach (GridHeaderItem rowHeader in nonLeafRowHeaders)
    {
        foreach (GridHeaderItem columnHeader in leafColumnHeaders)
        {
            // Get scorecard cells.
            GridCell cell = viewData.Cells[rowHeader, columnHeader];
    
            if (cell.IsCellEmpty || string.IsNullOrEmpty(cell.ActualValue.ToString()))
            {
                //do something with cell
            }
            viewData.Cells[rowHeader, columnHeader] = cell;
        }
    }