1

[简短提醒:英语不是我的母语:)]

你好,我有这个问题好几天了(它开始把我逼疯了)。

正如标题所说,我的问题是我需要在工作流中以编程方式更改(创建之前)KpiListItem 的“更新规则”参数。访问 Item 本身或任何东西都不是问题,但我找不到访问参数的方法。我找到了一个可能的解决方案(教程)来使用 KpiFactory (source)访问它,但是这个示例已经停留在我尝试调用“GetKpiData”-Function 的代码行中:(因为 emty 给了我一个异常object-array ...,但是在网上,SDK或我查过的一些书籍上无法获得有关GetKpiData-function的参数的一些信息)

SPListItem item = newWeb.Lists[nameIndicatorList].Items[0];
Assembly asm = System.Reflection.Assembly.Load("Microsoft.SharePoint.Portal, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c");
Type t = asm.GetType("Microsoft.SharePoint.Portal.WebControls.KpiFactory");
MethodInfo mi = t.GetMethod("GetKpi", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static, null, new Type[] { item.GetType() }, null);
object kpi = mi.Invoke(null, new object[] { item });
mi = kpi.GetType().GetMethod("GetKpiData", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance, null, new Type[] { }, null);
object kpidata = mi.Invoke(kpi, new object[] { });

(项目对象是我要访问的指标)

无论如何,我按照教程只是为了测试该属性是否可以访问。如果这行得通,那只会向前迈出半步,因为最后我想更改属性而不仅仅是读取它。

我希望有人能解决我的具体问题。真是让我头疼。(即使是部分答案也可能会有所帮助。)

真诚的,马库斯·施瓦尔贝

4

1 回答 1

0

You tagged the question as being Sharepoint 2010 related, but in the code you included, you try to load the 12.0.0.0 version of the Microsoft.SharePoint.Portal DLL. Is either a typo or could that be the problem (meaning that if you ARE using SP2010, you should have the code load the 14.0.0.0 version of the Microsoft.SharePoint.Portal DLL.

于 2011-01-10T12:06:38.127 回答