您建立的每個 Reporting Services 數據處理延伸模組都應該指派給唯一的命名空間,並內建於連結庫或元件檔中。 命名空間的確切名稱並不重要,但它必須是唯一的,且不會與任何其他延伸模組共用。 Microsoft會針對隨 Reporting Services 隨附的數據處理延伸模組使用 命名空間 Microsoft.ReportingServices.DataProcessing 。 您應該為公司的數據處理延伸模組建立自己的唯一命名空間。
下列範例示範開始 Reporting Services 數據處理延伸模組的程式代碼,其使用包含數據處理介面和任何公用程式類別的命名空間。
Imports System
Imports Microsoft.ReportingServices.DataProcessing
Imports Microsoft.ReportingServices.Interfaces
Namespace CompanyName.ExtensionName
...
using System;
using Microsoft.ReportingServices.DataProcessing;
using Microsoft.ReportingServices.Interfaces;
namespace CompanyName.ExtensionName
{
...
編譯 Reporting Services 數據處理延伸模組時,您必須向編譯程式提供 Microsoft.ReportingServices.Interfaces.dll的參考,因為數據處理延伸模組介面包含於該處。 需要 Microsoft.ReportingServices.DataProcessing 命名空間才能實作數據處理延伸模組介面,而且 Microsoft.ReportingServices.Interfaces 需要命名空間才能實作 IExtension 介面。 例如,如果包含實作以 C# 撰寫之 Reporting Services 數據處理延伸模組的所有檔案都位於擴展名為.cs的單一目錄中,則會從該目錄發出下列命令,以編譯儲存在 CompanyName.ExtensionName.dll中的檔案。
csc /t:library /out:CompanyName.ExtensionName.dll *.cs /r:System.dll /r:Microsoft.ReportingServices.Interfaces.dll
下列程式代碼範例顯示將用於擴展名為 .vb Microsoft Visual Basic 檔案的命令。
vbc /t:library /out:CompanyName.ExtensionName.dll *.vb /r:System.dll /r:Microsoft.ReportingServices.Interfaces.dll
備註
您也可以使用 Visual Studio 設計、開發及建置數據處理延伸模組。 如需在Visual Studio中開發元件的詳細資訊,請參閱Visual Studio檔。
另請參閱
Reporting Services 延伸模組
實作數據處理延伸模組
Reporting Services 擴充功能連結庫