如何部署自定义报表项

若要在 Reporting Services 中部署自定义报表项,必须修改报表服务器配置文件,并将设计时和运行时组件程序集复制到报表设计器和报表服务器的相应应用程序文件夹中。

部署自定义报表项

  1. 编辑 Rsreportdesigner.config 文件,以配置供在相应设计器中使用的自定义报表项运行时组件和设计时组件。 请注意,ReportItemName 条目必须与 CustomReportItemDesigner 类中使用的 CustomReportItemAttribute 属性匹配。 例如:

    <ReportItems>
       <ReportItem Name="Polygons" Type="PolygonsCRI.PolygonsCRI,PolygonsCRI"/>
    </ReportItems>
    <ReportItemDesigner>
       <ReportItem Name="Polygons" Type="PolygonsCRI.PolygonsDesigner, PolygonsDesigner" />
    </ReportItemDesigner>
    <ReportItemConverter>
       <Converter Source="Chart" Target="Polygons" Type="PolygonsCRI.PolygonsConverter, PolygonsDesigner" />
    </ReportItemConverter>
    
  2. 编辑 Rsreportserver.config 文件以注册自定义报表项运行时组件。 例如:

    <ReportItems>
       <ReportItem Name="Polygons" Type="PolygonsCRI.PolygonsCRI,PolygonsCRI"/>
    </ReportItems>
    
  3. 编辑 Rsssrvpolicy.config 文件以添加用于为相应自定义报表项授予合适权限的 CodeGroup。 例如:

    <CodeGroup 
       class="UnionCodeGroup" 
       version="1" 
       PermissionSetName="FullTrust"
       Description="This code group grants MyCustomReportItem.dll FullTrust permission. ">
       <IMembershipCondition 
          class="UrlMembershipCondition"
          version="1"
       Url="C:\Program Files\Microsoft SQL Server\ MSRS10_50.SQLSERVER\Reporting Services\ReportServer\bin\MyCustomReportItem.dll" />
    </CodeGroup>
    
  4. 将相应自定义报表项运行时组件 DLL 复制到 %ProgramFiles%\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies 和 \Program Files\Microsoft SQL Server\MSRS10_50.SQLSERVER\Reporting Services\ReportServer\bin 目录下。

  5. 将相应自定义报表项设计时组件 DLL 复制到 %ProgramFiles%\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies 目录下。

请参阅

概念

Reporting Services 配置文件

自定义报表项类库