SSRS レポートサーバーにADO.NET Provider を配置してActive Directory 連携

加藤龍彦
加藤龍彦
デジタルマーケティング
SSRS レポートサーバーからActive Directory のデータに連携してレポートを作成。ネイティブモードレポートサーバーでも、SharePoint farm でも。



この記事では、CData ADO.NET Provider for ActiveDirectory をSSRS レポートサーバーで配布する方法を説明します。また、共有データソースも作成します;共有データソースは、複数の帳票からリアルタイムActive Directory への接続を可能にします。共有データソースへは、Visual Studio のレポートデザイナーから接続できます。

ADO.NET Provider の配置

ネイティブモードのレポートサーバー、およびSharePoint server farm の一部としてインストールされたレポートサーバーに、同じ手順でプロバイダーを配布できます。プロバイダーに同梱されているInstallProvider.exe ユーティリティを使って、レポートサーバーにプロバイダーを配布します。InstallProvider.exe は、プロバイダーのインストールディレクトリの[lib]ブフォルダ内にあります。SQL サーバーのバージョン用のexe ファイルとSSRS フォルダを、配布するマシンにコピーします。/installssrs flag でexe ファイルを実行します。

.\InstallProvider.exe /installssrs PathToFolderWithSSRSDLL

Active Directory に共有データソースを作成

レポートサーバーから直接、またはSharePoint サイトから共有データソースを作成できます。あるいは、レポートデザイナーを使って作成することも可能です。

レポートデザイナー

レポートデザイナーを使って、ネイティブモードのレポートサーバーまたはSharePoint server farm のレポートサーバーで、共有データソースを作成できます。

  1. In a Report Server Project in Visual Studio, right-click Shared Data Sources in Solution Explorer and click Add New Data Source.
  2. Enter a name for the data source and in the Type menu select CData ActiveDirectory Report.
  3. In the Connection String box, enter the connection string to connect to Active Directory. A typical connection string is below:
    User=cn=Bob F,ou=Employees,dc=Domain;Password=bob123;Server=10.0.1.2;Port=389;

    ActiveDirectory 接続プロパティの取得・設定方法

    接続には以下の情報が必要です。

    • 有効なユーザーおよびパスワード情報 (例:Domain\BobF or cn=Bob F,ou=Employees,dc=Domain)。
    • 接続するサーバーのIP、ホスト名、ポートを含むサーバー情報。
    • BaseDN: 指定されたname にLDAP 検索の範囲を制限します。

      ちなみに、BaseDN を狭い範囲に設定することで大幅にパフォーマンスを改善できます。例えば、cn=users,dc=domain は、cn=users およびその子の範囲に戻り値の結果を制限します。

    接続を設定する際は、Max Rows 接続プロパティの設定もおすすめします。返される行数を制限できるため、レポートやビジュアライゼーションを作成する際のパフォーマンス向上に特に役立ちます。

    Properties to define a shared data source in Report Designer. (Salesforce is shown.)
  4. Set the folder and server URL in your project properties. If you are publishing to SharePoint, the values for all properties must be fully qualified URLs. For example:
    • Report Server: http://MyServerName/ReportServer
    • SharePoint: http://MyServerName/MySite/MySubsite
  5. Right-click the shared data source and click Deploy.

レポートサーバー

レポートサーバーのネイティブモードのインストールでは、Report Manager を使って共有データソースを作成できます。レポートサーバーでデータソースを管理する権限が必要です。

  1. From the Home page in Report Manager, click New Data Source. The New Data Source page is displayed.
  2. Enter a name for the data source and in the Data Source Type menu, select CData ActiveDirectory Report.
  3. In the Connection String box, enter the connection string to connect to Active Directory. A typical connection string is below:
     User=cn=Bob F,ou=Employees,dc=Domain;Password=bob123;Server=10.0.1.2;Port=389;
     

    ActiveDirectory 接続プロパティの取得・設定方法

    接続には以下の情報が必要です。

    • 有効なユーザーおよびパスワード情報 (例:Domain\BobF or cn=Bob F,ou=Employees,dc=Domain)。
    • 接続するサーバーのIP、ホスト名、ポートを含むサーバー情報。
    • BaseDN: 指定されたname にLDAP 検索の範囲を制限します。

      ちなみに、BaseDN を狭い範囲に設定することで大幅にパフォーマンスを改善できます。例えば、cn=users,dc=domain は、cn=users およびその子の範囲に戻り値の結果を制限します。

    Properties to define a shared data source in Report Manager. (Salesforce is shown.)

SharePoint

SharePoint サイトで共有データソースを作成する方法は、次のとおりです。レポートサーバーcontent タイプをライブラリに追加していない場合は、追加しておく必要があります:

  1. SharePoint にログインし、.rsds ファイルを保存したいライブラリを開きます。
  2. [Library Tools]タブで[Settings]リボングループから[Library Settings]をクリックします。
  3. [General Settings]セクションで[Advanced Settings] をクリックします。
  4. [Content Types]セクションで[Yes]を選択し、cntent タイプの管理を許可します。[Content Types]セクションは[Library Settings]ページに追加されます。
  5. 既存のサイトcontent タイプから[Add]をクリックします。
  6. [Available Site Content Types]リストから[レポートデータソース]を選択し、[Add]をクリックします。

これで、共有データソースを作成できます。Active Directory への接続情報を含む.rsds ファイルを作成します。

  1. Log into SharePoint and open the library where you want to save the .rsds file.
  2. On the ribbon click Documents -> New Document -> Report Data Source.
  3. Enter a name for the data source.
  4. In the Data Source Type menu, select CData ActiveDirectory Report.
  5. In the Connection String box, enter the connection string to connect to Active Directory. A typical connection string is below:
    User=cn=Bob F,ou=Employees,dc=Domain;Password=bob123;Server=10.0.1.2;Port=389;
    

    ActiveDirectory 接続プロパティの取得・設定方法

    接続には以下の情報が必要です。

    • 有効なユーザーおよびパスワード情報 (例:Domain\BobF or cn=Bob F,ou=Employees,dc=Domain)。
    • 接続するサーバーのIP、ホスト名、ポートを含むサーバー情報。
    • BaseDN: 指定されたname にLDAP 検索の範囲を制限します。

      ちなみに、BaseDN を狭い範囲に設定することで大幅にパフォーマンスを改善できます。例えば、cn=users,dc=domain は、cn=users およびその子の範囲に戻り値の結果を制限します。

    Properties to define a shared data source in SharePoint. (Salesforce is shown.)

はじめる準備はできましたか?

Active Directory Data Provider の無料トライアルをダウンロードしてお試しください:

 ダウンロード

詳細:

Active Directory Icon Active Directory ADO.NET Provider

.NET アプリケーションからActive Directory データへの連携機能を実装して、データをアプリから利用。