以编程方式更改性能点数据源连接

Zer*_*ity 5 datasource performancepoint sharepoint-2010

我在PPS中有很多报告,其中有大约60个数据源用于分析服务.我想更改他们的连接字符串(即我想要更改他们指向的服务器).我尝试过以下解决方案(控制台应用程序)来获取SharePoint for PPS中可用的数据源列表,但无法查看/修改连接字符串.

static void Main(string[] args)
    {
        DataTable dt = new DataTable();
        dt = GetList("SharePoint site URL", "Data Connections");

    }

    public static DataTable GetList(string site, string listname)
    {
        ClientContext ctx = new ClientContext(site);

        List lst = ctx.Web.Lists.GetByTitle(listname);

        CamlQuery cq = CamlQuery.CreateAllItemsQuery();

        ListItemCollection lic = lst.GetItems(cq);

        ctx.Load(lic);

        ctx.ExecuteQuery();
        DataTable dt = new DataTable();

        foreach (var field in lic[0].FieldValues.Keys)
        {
            dt.Columns.Add(field);
        }

        foreach (var item in lic)
        {
            DataRow dr = dt.NewRow();

            foreach (var obj in item.FieldValues)
            {
                if (obj.Value != null)
                {
                    string type = obj.Value.GetType().FullName;

                    if (type == "Microsoft.SharePoint.Client.FieldLookupValue")
                    {
                        dr[obj.Key] = ((FieldLookupValue)obj.Value).LookupValue;
                    }
                    else if (type == "Microsoft.SharePoint.Client.FieldUserValue")
                    {
                        dr[obj.Key] = ((FieldUserValue)obj.Value).LookupValue;
                    }
                    else
                    {
                        dr[obj.Key] = obj.Value;
                    }
                }
                else
                {
                    dr[obj.Key] = null;
                }
            }

            dt.Rows.Add(dr);
        }

        return dt;
    }
Run Code Online (Sandbox Code Playgroud)

使用上面的代码,我将在"数据连接"列表中获取所有数据连接(下面的屏幕截图是数据表结构)

在此输入图像描述

不幸的是,该信息中没有连接字符串.我无法在线找到任何解决方案.