创建传递扩展插件库

您创建的每个 Reporting Services 传递扩展插件都应分配到唯一的命名空间并被内置到某个库或程序集文件中。 命名空间的确切名称并不重要,但命名空间必须是唯一的且不能与任何其他扩展插件共享。 您应该为公司的传递扩展插件创建您自己的唯一命名空间。

以下示例说明开始某个 Reporting Services 传递扩展插件的代码,此扩展插件使用包含传递接口和任何实用工具类的命名空间。

Imports System
Imports Microsoft.ReportingServices.Interfaces

Namespace CompanyName.ExtensionName
   ...
using System;
using Microsoft.ReportingServices.Interfaces;

namespace CompanyName.ExtensionName
{
   ...

当编译 Reporting Services 传递扩展插件时,因为此处包含传递扩展插件接口和类,所以您必须向编译器提供对于 Microsoft.ReportingServices.Interfaces.dll 的引用。 Microsoft.ReportingServices.Interfaces 命名空间是实现 IExtension 接口、IDeliveryExtension 接口等所需的。 例如,如果所有文件(其中包含实现以 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 扩展插件

实现传递扩展插件