Custom Report Item Sample

Readme_Custom Report Item Sample

11/10/2009 10:36:06
哎!这个还是给程序员使用的并不是用户自定Report Item

This sample works only with SQL Server 2005 and SQL Server 2008. It will not work with any version of SQL Server earlier than SQL Server 2005.
PolygonsCRI is a simple custom report item sample. This sample uses the System.Component classes from the Microsoft .NET Framework and classes from the Microsoft.ReportDesigner and Microsoft.ReportingServices namespaces to implement a custom report item run-time component and design-time component that can be used in Report Designer.

Important:
Samples are provided for educational purposes only. They are not intended to be used in a production environment and have not been tested in a production environment. Microsoft does not provide technical support for these samples. Sample applications and assemblies should not be connected to or used with your production SQL Server database or your report server without the permission of the system administrator.

 

Requirements

You should be familiar with Visual Studio and Microsoft Visual C#, and your system must meet the following requirements to use the PolygonsCRI sample:

  • Microsoft SQL Server with Reporting Services.
  • Microsoft SQL Server Business Intelligence Development Studio.
  • Microsoft Visual Studio 2008.
  • Microsoft .NET Framework 2.0.
  • Reporting Services samples.
  • A report server that you have permission to access on your network.
Note:
Business Intelligence Development Studio is not supported on Itanium-based computers. However, support is available for x64-based computers. If the SQL Server sample databases have been deployed on an Itanium-based computer, use BI Development Studio on either an x86-based or x64-based computer to modify and run the samples.
Important:
SQL Server samples and sample databases must be downloaded and installed before you can view or work with them. For more information, see Considerations for Installing SQL Server Samples and Sample Databases.

 

Location

By default, this sample is located in the following directory:
C:/Program Files/Microsoft SQL Server/100/Samples/Reporting Services/Extension Samples/PolygonCustomReportItem Sample

Building the Sample

If you have not already created a strong name key file, generate the key file using the following instructions.

To generate a strong name key file
  1. Open a Microsoft Visual Studio 2005 command prompt. Click Start, point to All Programs, point to Microsoft Visual Studio 2008, then point to Visual Studio Tools, and then click Visual Studio 2008 Command Prompt.
  2. Use the change directory command (CD) to change the current directory of the command prompt window to the folder where the samples are installed. Note: To determine the folder where samples are located, click the Start* button, point to All Programs, point to Microsoft SQL Server, point to Documentation and Tutorials, and then click Samples Directory. If the default installation location was used, the samples are located in <system_drive>:/Program Files/Microsoft SQL Server/100/Samples.*
  3. At the command prompt, run the following command to generate the key file: sn -k SampleKey.snk Important: For more information about the strong-name key pair, see "Security Briefs: Strong Names and Security in the .NET Framework" in the .NET Development Center on MSDN.
To build the PolygonsCRI sample
  1. Open the /CS/PolygonsCRI.sln project file into Visual Studio 2008.
  2. From the Build menu, select Build Solution.

Deploying the Sample

To deploy the PolygonsCRI sample
  1. Edit the rsreportserver.config file (by default located in the directory %ProgramFiles%/Microsoft SQL Server/MSRS10.MSSQLSERVER/Reporting Services/ReportServer) to register the PolygonsCRI:
  2. Insert the following lines before the </Extensions> line:
<ReportItems>
   <ReportItem Name="Polygons" Type="Microsoft.Samples.ReportingServices.PolygonsCustomReportItem,PolygonsCRI"/>
</ReportItems> 
  1. Edit the rssrvpolicy.config file (by default located in the directory %ProgramFiles%/Microsoft SQL Server/MSRS10.MSSQLSERVER/Reporting Services/ReportServer) to add a code group for the custom report item:
  2. Add the following lines and change the PROGRAMFILES string to your Program Files directory:
<CodeGroup 
   class="UnionCodeGroup" 
   version="1" 
   PermissionSetName="FullTrust"
   Description="This code group grants PolygonsCRI.dll FullTrust permission. ">
   <IMembershipCondition 
   class="UrlMembershipCondition"
   version="1"
   Url="PROGRAMFILES/Microsoft SQL Server/MSRS10.MSSQLSERVER/Reporting Services/ReportServer/bin/PolygonsCRI.dll" />
</CodeGroup> 
  1. Edit the rsreportdesigner.config file (by default located in the directory C:/Program Files/Microsoft Visual Studio 9.0/Common7/IDE/PrivateAssemblies) to register the run-time component, the design-time component, and the item type converter:
  2. Add the following lines before the </Extensions> line:
<ReportItems>
   <ReportItem Name="Polygons" Type="Microsoft.Samples.ReportingServices.PolygonsCustomReportItem,PolygonsCRI"/>
</ReportItems>
<ReportItemDesigner>
   <ReportItem Name="Polygons" Type=" Microsoft.Samples.ReportingServices.PolygonsDesigner, PolygonsDesigner" />
</ReportItemDesigner> 
  1. Copy the PolygonsCRI.dll file from the /CS/PolygonsCRI/Bin/Debug directory where you copied the sample project to the Visual Studio private assemblies directory (by default, %ProgramFiles%/Microsoft Visual Studio 9.0/Common7/IDE/PrivateAssemblies).
  2. Copy the PolygonsCRI.dll file from the /CS/PolygonsCRI/Bin/Debug directory where you copied the sample project to the Microsoft SQL Server Reporting Services bin directory (by default, %ProgramFiles%/Microsoft SQL Server/MSRS10.MSSQLSERVER/Reporting Services/ReportServer/Bin).
  3. Copy the PolygonsDesigner.dll file from the /CS/PolygonDesigner/Bin/Debug directory to the Visual Studio private assemblies directory (by default, %ProgramFiles%/Microsoft Visual Studio 9.0/Common7/IDE/PrivateAssemblies).

Running the Sample

This section contains a quick walkthrough that shows how to reference the Polygon custom report item in Visual Studio and then test it.

To add PolygonDesigner to the Visual Studio Toolbox
  1. Right-click the Visual Studio Toolbox.
  2. Select Choose items.
  3. Navigate to the %ProgramFiles%/Microsoft Visual Studio 9.0/Common7/IDE/PrivateAssemblies folder and select PolygonsDesigner.dll.
To publish and view the sample on the report server
  1. Restart the Reporting Services service by running the following commands at the command prompt:
    1. net stop "SQL Server Reporting Services InstanceName"
    2. net start "SQL Server Reporting Services InstanceName"
  2. With the Polygons.sln solution opened, in the Solution Explorer, right-click the Polygons project, and click Deploy.
  3. In the brower, access the report server URL and click the Polygons report to view it.

To edit a report using the PolygonDesigner custom control in Visual Studio, you can do any of the following:

  • Set the properties of the polygons control in the property browser.
  • Edit properties through the control's shortcut menu.
  • Drag fields onto the drop areas of the control from the fields list.

See Also

Tasks

Compiling and Running Code Examples Reporting Services Samples

Other Resources

Custom Report Item Implementation Requirements Extension Samples (Reporting Services)

中文名: SQL Server 2008 R2详解手册 原名: Microsoft SQL Server 2008 R2 Unleashed 作者: Ray Rankins Paul Bertucci Chris Gallelli Alex T.Silverstein 资源格式: PDF 版本: 影印版 出版社: Sams书号: 978-0672330568发行时间: 2010年09月26日 地区: 美国 语言: 英文 简介: 内容简介: Microsoft SQL Server 2008 R2 Unleashed includes full coverage of SQL Server 2008 in addition to R2 coverage This is the industry the most comprehensive and useful guide to SQL Server 2008 and 2008 R2. It presents start-to-finish coverage of SQL Server core database server and management capabilities, plus complete introductions to Integration, Reporting, and Analysis Services, application development, and much more. Four expert SQL Server administrators, developers, and consultants have packed this book with real-world information, tips, guidelines, and samples drawn from their own extensive experience creating and managing complex database solutions. Writing for intermediate-to-advanced-level SQL Server professionals, they focus on the product most complex and powerful capabilities, and its newest tools and features. For example, you will find invaluable information on administering SQL Server more efficiently, analyzing and optimizing queries, implementing data warehouses, ensuring high availability, and tuning performance. The accompanying CD-ROM contains an extraordinary library of practical tools and information including sample databases and all code examples. Whether you’re responsible for SQL Server 2008 analysis, design, implementation, support, administration, or troubleshooting, no other book offers you this much value. * Understand the Microsoft SQL Server 2008 environment, R2 for newest features, and each edition capabilities * Manage SQL Server 2008 more effectively with SQL Server Management Studio, the SQLCMD command-line query tool, and Powershell * Efficiently manage security, users, backup/restore, replication, Database Mail, and database objects from tables and indexes to stored procedures and triggers * Increase availability with clustering, database mirroring, and other features * Use new Policy-Based Management to centrally configure and operate SQL Server throughout the organization * Use SQL Server Profiler to capture queries and identify bottlenecks * Improve performance by optimizing queries, design more effective databases, and manage workloads with the new Resource Governor * Develop applications using SQL Server 2008 enhancements to T-SQL and SQLCLR, .NET integration, LINQ to SQL, XML, and XQuery 作者介绍: Ray Rankins, president of Gotham Consulting Services, has worked with Sybase and Microsoft SQL Server for more than 23 years and is coauthor of Sybase SQL Server Unleashed, Microsoft SQL Server 2000 Unleashed, and Microsoft SQL Server 2005 Unleashed. Paul Bertucci, founder of Database Architechs, has more than 30 years of experience in database design, architecture, replication, tuning, integration, and high availability. Chris Gallelli, president of CGAL Consulting Services, specializes in database administration, tuning, and programming. Alex T. Silverstein is managing principal and chief architect of Unified Digital Group, LLC, a developer of custom SQL Server and Microsoft .NET solutions. 目录: Introduction Part I Welcome to Microsoft SQL Server 1. SQL Serve 2008 Overview 2. What’s new in SQL Serve 2008 3. Examples of SQL Server Implementations Part II SQL Server Tools and Utilities 4. SQL Server Management Studio 5. SQL Server Command-Line Utilities 6. SQL Server Profiler Part III SQL Server Administration 7. SQL Server System and Database Administration 8. Installing SQL Serve 2008 9. Upgrading to SQL Serve 2008 10. Client Installation and Configuration 11. Security and User Administration ………
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值