English 中文(简体)
Changing the "update rules"-parameter of a KpiListItem in SharePoint 2010 programmatically
原标题:

[ short reminder: english is not my native language :) ]

Hello, I have this problem for a few days now (and it starts to drive me seriously mad).

Like the title says, my problem is that I need to change the "update rules"-parameter of a (before created) KpiListItem programmatically within a workflow. It s not an issue to access the Item itself or anything, but I can t find a mean to access the parameter. I found a possible solution (tutorial) to access it with the KpiFactory (source), but this examples already stucks in my code on the line where I try to invoke the "GetKpiData"-Function: (Giving me an exception because of the emty object-array..., but it s impossible to get some information about the parameters for the GetKpiData-function on the net, the SDK or some books I checked)

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[] { });

(The item-object is the indicator I want to access)

Anyway, I followed the tutorial just to test if the property is even reachable. If this works, it would only be an half step forward, because in the end I want to change the property and not just read it.

I hope that someone has a solution for my specific problem. It really gives me a headache. (Even partial anwser may help.)

sincerely, Markus Schwalbe

问题回答

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.





相关问题
KPI Adjustment Table

I have a table with monthly summary of KPIs. The customer now wants to be able to make adjustments to the original data. I have to allow for adjustments as well as preserving the original data. The ...

Development Manager KPIs

I m a development manager for a medium sized company. I ve never had specific KPI s before and now I am being given some. The KPIs I ve been given I don t think relate too well to my role. I would ...

KPI for UX team

I m going to lead a new User Experience Team and I m struggling with the definition of KPI for the team. My question is non-technical and I m asking after what KPI s I should measure.

In SharePoint, graphically display data from a web service

[SharePoint/MOSS 2007] I want to access several web services (on external sites, with WSDL descriptors), and graphically display the data, using a separate web part to display each item. The graph ...

Help on Website response time KPI parameters

I am working on improving website performance. Here are the list of key performance indicators I am looking at for each page Total Bytes downloaded Number of requests DNS look up time FirstByte ...

热门标签