Question

Is there a way to retrieve the names and corresponding mdx queries of charts and reports deployed on a sharepoint site ?
i am using Shrepoint 2010

Was it helpful?

Solution

SharePoint Server 2010 uses the PPSAuthoringService web service instead of PmService. If you havent seen it yet, check out this post on the PerformancePoint Services team blog: http://blogs.msdn.com/b/performancepoint/archive/2010/09/13/using-the-ppsauthoringservice-web-service.aspx

The OLAP report's query is stored in the ReportView.CustomData property. Something like this should work (even though this example calls the web service from the API). Warning--I'm an amateur programmer.

2/4/11 -- Instead of querying the report's CustomData prop as shown below, you can just pass the report location to the GetMdx method.

static void Main(string[] args)
{
    string pathToAuthoringService = "http://<serverName>/_vti_bin/PPS/PPSAuthoringService.asmx";
    IBIMonitoringAuthoring service = BIMonitoringAuthoringServiceProxy.CreateInstance(pathToAuthoringService);

    string listUrl = "/BICenter/Lists/PerformancePoint Content/";
    FirstClassElementCollection fcos = service.GetListItems(listUrl);
    Dashboard dashboard = new Dashboard();

    foreach (FirstClassElement fco in fcos)
    {
        if (fco.ContentType == FCOContentType.PpsDashboard && fco.Name.Text == "Contoso Sales Management")
        {
            dashboard = fco as Dashboard;
        }
    }

    // Or if you know the ItemUrl, you can retrieve the dashboard directly.
    //RepositoryLocation dashboardLocation = new RepositoryLocation("/BICenter/Lists/PerformancePoint Content/32._000");
    //Dashboard dashboard = service.GetDashboard(dashboardLocation);

    List<RepositoryLocation> childLocations = dashboard.GetChildFCOLocations();
    foreach (RepositoryLocation location in childLocations)
    {
        if (location.ItemType == FirstClassObjectType.ReportView)
        {
            ReportView report = service.GetReportView(location);

            if (report.IsAnalyticReport())
            {
                Console.WriteLine(report.CustomData);
        }
    }
}

}

OTHER TIPS

You would open up the PPS designer application and you could see the names of the charts used on the dashboard and from the report you can switch to design mode to see the MDX.

Otherwise you can also run SQL Profiler to trace the queries sent from PPS to Analysis Services. You have to be aware that PPS does a lot of caching, I think it is 10-20 minutes by default so if you miss that first query you may need to wait a while before the query is sent again.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top