2009-06-15 29 views
2

(プロバイダ)businessdataフィルターwebpartからBDCリストWebPartに「クエリ値」を入力します。私は接続しようとするとエラーが発生します。 "プロバイダ接続ポイント(BusinessDataFilterWebPart)とコンシューマ接続ポイント" BusinessDataListWebPart "は同じ接続インターフェイスを使用しません。BDC Webパーツ接続インターフェイスエラー

以下は私のコードスニペットです。

System.Web.UI.WebControls.WebParts.WebPart providerWebPart = 
       webPartManager.WebParts[filterWebPart.ID]; 
      ProviderConnectionPointCollection providerConnections = 
       webPartManager.GetProviderConnectionPoints(providerWebPart); 
      ProviderConnectionPoint providerConnection = null; 
      foreach (ProviderConnectionPoint ppoint in providerConnections) 
      { 
       if (ppoint.InterfaceType == typeof(ITransformableFilterValues)) 
        providerConnection = ppoint; 

      } 
      System.Web.UI.WebControls.WebParts.WebPart consumerWebPart = 
       webPartManager.WebParts[consumer.ID]; 
      ConsumerConnectionPointCollection consumerConnections = 
       webPartManager.GetConsumerConnectionPoints(consumerWebPart); 
      ConsumerConnectionPoint consumerConnection = null; 

      foreach (ConsumerConnectionPoint cpoint in consumerConnections) 
      { 
       if (cpoint.InterfaceType == typeof(IWebPartParameters)) 
        consumerConnection = cpoint; 
      } 

SPWebPartConnection newConnection = webPartManager.SPConnectWebParts(
       providerWebPart, providerConnection, consumerWebPart, consumerConnection); 

答えて

0

2つの異なる接続インターフェイスを比較しているようです。プロバイダ接続はITransformableFilterValuesを実装し、コンシューマ接続はIWebPartParametersを実装します。

コードでWebパーツ間の接続をめったに書いていないので、ここで書いたコードについてよく分かりません。しかし、接続に関する全体的なポイントは、消費者とプロバイダーが同じインターフェースを提供し、期待する必要があることです。

これらの2つのWebパーツをブラウザインターフェイスで一緒に接続しようとしましたか?

0

この問題の直接の経験は、プロバイダとしてのクエリ文字列フィルタWebパーツとコンシューマとしてのレポートビューアWebパーツの問題ですが、問題は同じでした。

ITransformableFilterValuesインターフェイスは、IWebPartParametersインターフェイスでは使用できません。ただし、接続ポイントコレクション内の各アイテムは異なるインターフェイスタイプを実装しています。

デバッガで、ConsumerConnectionPointCollectionとProviderConnectionPointConnectionの両方で実装されている他のインターフェイスタイプを確認します。両方のコレクションに同じインターフェイスタイプを実装する接続がある場合は、インターフェイスタイプをチェックしているforeachでそのインターフェイスタイプを使用します。

ダイレクトマッチがない場合は、適切な組み合わせを試してみる必要があります。

0

2つのインターフェイスが接続/変換できるように、適切なトランスフォーマとトランスフォームによるオーバーライド方法をパラメータとして使用する必要があります。

var transformer = new TransformableFilterValuesToParametersTransformer(); 
       transformer.ProviderFieldNames = new string[] { "DocumentIdForCurrentPage" }; 
       transformer.ConsumerFieldNames = new string[] { "DocumentId" }; 

"Microsoft.SharePoint.WebPartPages.ITransformableFilterValuesを実装する標準フィルタは、IWebPartParametersを消費することができる任意のWebパーツに接続することを許可します" webPartManager.SPConnectWebParts( providerWebPart、providerConnection、:TransformableFilterValuesToParametersTransformer上のMSDNドキュメントからconsumerWebPart、consumerConnection、transformer);

関連する問題