13544870125 发表于 2015-7-3 12:52:28

SQL Server 2005 Reporting Services 使用C#类库中的函数方法

1 首先准备一个普通的类库,里面有Reporing 需要的方法,方法的定义如下:

            public static string 函数名称(参数)
            {}

2 把类库编译成一个dll

3 把dll拷贝到一下三个目录:

C:\Program Files\Microsoft SQL Server\MSSQL.4\Reporting Services\ReportManager\Bin
C:\Program Files\Microsoft SQL Server\MSSQL.4\Reporting Services\ReportServer\bin
C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies

4 在报表中使用自定义函数:
         Visual Studio中找到Report menu——〉Report Properties。。。——〉References 添加引用

5 使用Code:名称空间.类名称.函数名称(参数)

6 OK
页: [1]
查看完整版本: SQL Server 2005 Reporting Services 使用C#类库中的函数方法