连接Provider和Consumer之间的麻烦

时间:2014-04-09 13:29:51

标签: c# sharepoint-2013 web-parts performancepoint

将PPS过滤器WebPart(提供商)连接到自定义Webpart(消费者)时遇到问题。

当前实施:

public partial class SQLTextWebPart : WebPart , Microsoft.SharePoint.WebPartPages.IFilterValues {
    private Microsoft.SharePoint.WebPartPages.IFilterValues _provider = null;

    [ConnectionConsumer("Filter Consumer", "FilterConsumer")]
    public void FilterValueConsumer ( Microsoft.SharePoint.WebPartPages.IFilterValues Provider ) {
        _provider = Provider;
    }

    protected override void OnPreRender ( EventArgs e ) {
        EnsureChildControls();

        if ( _provider != null ) {
            lblFilterValue.Text = _provider.ParameterName + ": " + _provider.ParameterValues[ 0 ];
        }

        ////Execute BaseClass OnPreRender - Last
        //base.OnPreRender( e );
    }

    #region IFilterValues Members

    public string ParameterName {
        get { throw new NotImplementedException(); }
    }

    public ReadOnlyCollection<string> ParameterValues {
        get { throw new NotImplementedException(); }
    }

    public void SetConsumerParameters ( ReadOnlyCollection<Microsoft.SharePoint.WebPartPages.ConsumerParameter> parameters ) {
        throw new NotImplementedException();
    }

    #endregion
}

然后当我尝试将连接发送到SQLTextWebPart或从PPS过滤器获取连接时,弹出窗口并出现CorrelationID。对日志文件进行了PowerShell查询并获得了此结果。仍然习惯于SharePoint的格式化及其异常处理,所以也许有人更多地了解格式可以帮助理解它。

Area     : SharePoint Foundation
Category : Logging Correlation Data
Level    : Medium
EventID  : xmnv
Message  : Name=Request (POST:http://sitecollection/sites/Portal/_layouts/15
           /AspXform.aspx?pageUrl=http://sitecollection/sites/Portal/Pages/S
           andbox.aspx&sWpId=g_91ed55d1_12e9_4773_b57c_6ae597ef291b&sGroupId=Tr
           ansformableBIDataProvider&tWpId=g_2ade4a5b_60f1_48b7_85a4_734f40b477
           57&tGroupId=FilterConsumer&xFormType=Microsoft.PerformancePoint.Scor
           ecards.WebControls.Transforms.TransformableBIDataProviderToFilterVal
           uesTransformer, Microsoft.PerformancePoint.Scorecards.WebControls, 
           Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c&x
           FormInfo=&isMultiGroup=False&isConnected=False)

Area     : SharePoint Foundation
Category : Request Management
Level    : Medium
EventID  : adc7u
Message  : Mapping URI from 'http://sitecollection:80/sites/Portal/_layouts/
           15/AspXform.aspx?pageUrl=http%3A%2F%2Fsitecollection%2Fsites%2FPo
           rtal%2FPages%2FSandbox%2Easpx&sWpId=g%5F91ed55d1%5F12e9%5F4773%5Fb57
           c%5F6ae597ef291b&sGroupId=TransformableBIDataProvider&tWpId=g%5F2ade
           4a5b%5F60f1%5F48b7%5F85a4%5F734f40b47757&tGroupId=FilterConsumer&xFo
           rmType=Microsoft%2EPerformancePoint%2EScorecards%2EWebControls%2ETra
           nsforms%2ETransformableBIDataProviderToFilterValuesTransformer%2C%20
           Microsoft%2EPerformancePoint%2EScorecards%2EWebControls%2C%20Version
           %3D15%2E0%2E0%2E0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3D71e9b
           ce111e9429c&xFormInfo=&isMultiGroup=False&isConnected=False' to 'htt
           p://domainsite/sites/Portal/_layouts/15/AspXform.aspx?pageUrl=h
           ttp%3A%2F%2Fsitecollection%2Fsites%2FPortal%2FPag...

Area     : SharePoint Foundation
Category : Logging Correlation Data
Level    : Medium
EventID  : xmnv
Message  : Name=Request (POST:http://sitecollection:80/sites/Portal/_layouts
           /15/AspXform.aspx?pageUrl=http%3A%2F%2Fsitecollection%2Fsites%2FP
           ortal%2FPages%2FSandbox%2Easpx&sWpId=g%5F91ed55d1%5F12e9%5F4773%5Fb5
           7c%5F6ae597ef291b&sGroupId=TransformableBIDataProvider&tWpId=g%5F2ad
           e4a5b%5F60f1%5F48b7%5F85a4%5F734f40b47757&tGroupId=FilterConsumer&xF
           ormType=Microsoft%2EPerformancePoint%2EScorecards%2EWebControls%2ETr
           ansforms%2ETransformableBIDataProviderToFilterValuesTransformer%2C%2
           0Microsoft%2EPerformancePoint%2EScorecards%2EWebControls%2C%20Versio
           n%3D15%2E0%2E0%2E0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3D71e9
           bce111e9429c&xFormInfo=&isMultiGroup=False&isConnected=False)

Area     : SharePoint Foundation
Category : Authentication Authorization
Level    : Medium
EventID  : agb9s
Message  : Non-OAuth request. IsAuthenticated=True, 
           UserIdentityName=0#.w|domain\username, ClaimsCount=50

Area     : SharePoint Foundation
Category : Logging Correlation Data
Level    : Medium
EventID  : xmnv
Message  : Site=/sites/Portal

Area     : SharePoint Foundation
Category : Files
Level    : High
EventID  : ak8dj
Message  : UserAgent not available, file operations may not be optimized.    
           at Microsoft.SharePoint.SPFileStreamManager.CreateCobaltStreamContai
           ner(SPFileStreamStore spfs, ILockBytes ilb, Boolean 
           copyOnFirstWrite, Boolean disposeIlb)     at Microsoft.SharePoint.SP
           FileStreamManager.SetInputLockBytes(SPFileInfo& fileInfo, 
           SqlSession session, PrefetchResult prefetchResult)     at Microsoft.
           SharePoint.CoordinatedStreamBuffer.SPCoordinatedStreamBufferFactory.
           CreateFromDocumentRowset(Guid databaseId, SqlSession session, 
           SPFileStreamManager spfstm, Object[] metadataRow, SPRowset 
           contentRowset, SPDocumentBindRequest& dbreq, SPDocumentBindResults& 
           dbres)     at 
           Microsoft.SharePoint.SPSqlClient.GetDocumentContentRow(Int32 
           rowOrd, Object ospFileStmMgr, SPDocumentBindRequest& dbreq, 
           SPDocumentBindResults& dbres...

Area     : SharePoint Foundation
Category : Files
Level    : Medium
EventID  : aiv4w
Message  : Spent 0 ms to bind 3096 byte file stream

Area     : SharePoint Foundation
Category : Files
Level    : Medium
EventID  : ahjkm
Message  : Spent 0 ms to send 3096 byte file stream

Area     : SharePoint Foundation
Category : General
Level    : Medium
EventID  : 8nca
Message  : Application error when access /_layouts/15/AspXform.aspx, 
           Error=Object reference not set to an instance of an object.   at Mic
           rosoft.PerformancePoint.Scorecards.WebControls.Transforms.Transforma
           bleBIDataProviderToFilterValuesTransformer.get_ConsumerParameters() 
               at Microsoft.PerformancePoint.Scorecards.WebControls.Transforms.
           TransformableBIDataProviderToFilterValuesUI.CreateContentRow()     
           at Microsoft.PerformancePoint.Scorecards.WebControls.Transforms.Tran
           sformerUIBase.OnLoad(EventArgs e)     at 
           System.Web.UI.Control.LoadRecursive()     at 
           System.Web.UI.Control.LoadRecursive()     at 
           System.Web.UI.Control.LoadRecursive()     at 
           System.Web.UI.Control.LoadRecursive()     at 
           System.Web.UI.Control.LoadRecursive()     at 
           System.Web.UI.Control.LoadRecursive()     at 
           System.Web.UI.Control.Lo...

Area     : SharePoint Foundation
Category : Runtime
Level    : Unexpected
EventID  : tkau
Message  : System.NullReferenceException: Object reference not set to an 
           instance of an object.    at Microsoft.PerformancePoint.Scorecards.W
           ebControls.Transforms.TransformableBIDataProviderToFilterValuesTrans
           former.get_ConsumerParameters()     at Microsoft.PerformancePoint.Sc
           orecards.WebControls.Transforms.TransformableBIDataProviderToFilterV
           aluesUI.CreateContentRow()     at Microsoft.PerformancePoint.Scoreca
           rds.WebControls.Transforms.TransformerUIBase.OnLoad(EventArgs e)    
            at System.Web.UI.Control.LoadRecursive()     at 
           System.Web.UI.Control.LoadRecursive()     at 
           System.Web.UI.Control.LoadRecursive()     at 
           System.Web.UI.Control.LoadRecursive()     at 
           System.Web.UI.Control.LoadRecursive()     at 
           System.Web.UI.Control.LoadRecursive()     at 
           System.Web.UI.Control.LoadRecursive()     at System.Web....

Area     : SharePoint Foundation
Category : General
Level    : High
EventID  : ajlz0
Message  : Getting Error Message for Exception 
           System.Web.HttpUnhandledException (0x80004005): Exception of type 
           'System.Web.HttpUnhandledException' was thrown. ---> 
           System.NullReferenceException: Object reference not set to an 
           instance of an object.     at Microsoft.PerformancePoint.Scorecards.
           WebControls.Transforms.TransformableBIDataProviderToFilterValuesTran
           sformer.get_ConsumerParameters()     at Microsoft.PerformancePoint.S
           corecards.WebControls.Transforms.TransformableBIDataProviderToFilter
           ValuesUI.CreateContentRow()     at Microsoft.PerformancePoint.Scorec
           ards.WebControls.Transforms.TransformerUIBase.OnLoad(EventArgs e)   
             at System.Web.UI.Control.LoadRecursive()     at 
           System.Web.UI.Control.LoadRecursive()     at 
           System.Web.UI.Control.LoadRecursive()     at 
           System.Web.UI.Control.LoadRecursive...

Area     : SharePoint Foundation
Category : General
Level    : Monitorable
EventID  : aat87
Message  : 

Area     : SharePoint Foundation
Category : Request Management
Level    : High
EventID  : advu2
Message  : [Forced due to logging gap, cached @ 04/09/2014 08:00:32.94, 
           Original Level: Verbose] Size of data: '{0}' bytes

Area     : SharePoint Foundation
Category : Request Management
Level    : High
EventID  : aht6j
Message  : [Forced due to logging gap, Original Level: Verbose] Proxy response 
           duration: WFE '{0}', RM '{1}'

Area     : SharePoint Foundation
Category : Monitoring
Level    : Medium
EventID  : b4ly
Message  : Leaving Monitored Scope (Request (POST:http://sitecollection:80/s
           ites/Portal/_layouts/15/AspXform.aspx?pageUrl=http%3A%2F%2Fportaldev
           elopment%2Fsites%2FPortal%2FPages%2FSandbox%2Easpx&sWpId=g%5F91ed55d
           1%5F12e9%5F4773%5Fb57c%5F6ae597ef291b&sGroupId=TransformableBIDataPr
           ovider&tWpId=g%5F2ade4a5b%5F60f1%5F48b7%5F85a4%5F734f40b47757&tGroup
           Id=FilterConsumer&xFormType=Microsoft%2EPerformancePoint%2EScorecard
           s%2EWebControls%2ETransforms%2ETransformableBIDataProviderToFilterVa
           luesTransformer%2C%20Microsoft%2EPerformancePoint%2EScorecards%2EWeb
           Controls%2C%20Version%3D15%2E0%2E0%2E0%2C%20Culture%3Dneutral%2C%20P
           ublicKeyToken%3D71e9bce111e9429c&xFormInfo=&isMultiGroup=False&isCon
           nected=False)). Execution Time=71.8682

Area     : SharePoint Foundation
Category : Monitoring
Level    : Medium
EventID  : b4ly
Message  : Leaving Monitored Scope (Request (POST:http://sitecollection/site
           s/Portal/_layouts/15/AspXform.aspx?pageUrl=http://sitecollection/
           sites/Portal/Pages/Sandbox.aspx&sWpId=g_91ed55d1_12e9_4773_b57c_6ae5
           97ef291b&sGroupId=TransformableBIDataProvider&tWpId=g_2ade4a5b_60f1_
           48b7_85a4_734f40b47757&tGroupId=FilterConsumer&xFormType=Microsoft.P
           erformancePoint.Scorecards.WebControls.Transforms.TransformableBIDat
           aProviderToFilterValuesTransformer, 
           Microsoft.PerformancePoint.Scorecards.WebControls, 
           Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c&x
           FormInfo=&isMultiGroup=False&isConnected=False)). Execution 
           Time=75.3427

1 个答案:

答案 0 :(得分:1)

最后解决了我的所有连接问题,并在SharePoint Exchange中编写了Q&amp; A样式帖子,Visual Web Part as consumer of PPS Filter Provider

如果其他人登陆此帖子,他们应该能够阅读有关成功实施的步骤。