Readme_File Share Data Processing Extension Sample
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.
FsiDataExtension is a simple data processing extension for the Windows file system. It uses the Microsoft .NET Framework library classes
to query the contents of any valid network file share. The sample uses the data processing extension interfaces as well as other .NET Framework classes. The naming convention used for the sample
is the prefix "Fsi", for File Share Information. This sample is not supported on Itanium-based operating systems.
|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.
You should be familiar with Microsoft Visual Studio and either Microsoft Visual C# or Microsoft Visual Basic, and you should have the following installed to use the FsiDataExtension sample:
- Microsoft Visual Studio 2005 or compatible development environment (for viewing the project files).
- Microsoft SQL Server, including Reporting Services.
- Microsoft .NET Framework 2.0.
- Reporting Services samples. You can choose to install the samples during SQL Server setup. For this release, when you choose to install samples, a separate installer is installed on your computer that you can start to extract and install samples. You can
run this installer from the Start menu in the Microsoft SQL Server program group.
- A report server that you have permission to access on your network, if you plan to use the sample extension to add more data processing functionality to your server.
|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.
By default, this sample is located in the following directory:
C:\Program Files\Microsoft SQL Server\100\Samples\Reporting Services\Extension
Building the Sample
Follow these steps to build 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
- Open a Microsoft Visual Studio 2005 command prompt. Click Start, point to
All Programs, point to Microsoft .NET Framework SDK 2.0, and then click
SDK Command Prompt.-- or --Open a Microsoft .NET Framework command prompt. Click
Start, point to All Programs, point to Microsoft .NET Framework SDK 2.0, and then click
SDK Command Prompt.
- 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.*
- 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 compile the sample using the .NET Framework SDK
- Copy Microsoft.ReportingServices.Interfaces.dll from the report server \bin directory into your samples folder.
- Issue the following commands to create the sample data processing extension Microsoft.Samples.ReportingServices.FsiDataExtension.dll. * csc.exe /t:library /out:Microsoft.Samples.ReportingServices.FsiDataExtension.dll *.cs .\properties\*.cs /res:.\properties\Resources.resx
To compile the sample using Visual Studio .NET
- Open the FsiDataExtension solution file (FsiDataExtensionCS.sln or FsiDataExtensionVB.sln) in Visual Studio 2005.
- In Solution Explorer, select the FsiDataExtension project.
- On the Project menu, click Add Reference.
- On the Add References dialog box, click the .NET tab.
- Click Browse, and navigate to find Microsoft.ReportingServices.Interfaces on your local drive. By default, the assembly is located in the ReportServer\bin directory. Click
OK. The selected reference is added to your project. Note: The reference may already be added to your project. If this is the case, you do not have to re-add a reference.
- On the Build menu, click Build Solution.
Deploying the Sample
After you have completed the previous steps, Microsoft.Samples.ReportingServices.FsiDataExtension.dll can be deployed to a report server or to Report Designer for use in running reports against a custom data source.
To deploy the sample
- Copy Microsoft.Samples.ReportingServices.FsiDataExtension.dll to the report server. The default location for report server extensions is C:\Program Files\Microsoft SQL Server\MSRS10.MSSQLSERVER\Reporting Services\ReportServer\bin.
- Copy the assembly to Report Designer. The default location for extensions for Report Designer is C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies.
- Add the following entry to both the RSReportServer.config and RSReportDesigner.config files under the
Data element (the default location of the RSReportDesigner.config file is C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies, and the default location for the RSReportServer.config file is C:\Program Files\Microsoft SQL Server\MSRS10.MSSQLSERVER\Reporting
Services\ReportServer): * <Extension Name="FSI" Type="Microsoft.Samples.ReportingServices.FsiDataExtension.FsiConnection,Microsoft.Samples.ReportingServices.FsiDataExtension"/> *
- To enable the generic query designer for the sample data processing extension, add the following entry to the RSReportDesigner.config file under the
Designer element. * <Extension Name="FSI" Type="Microsoft.ReportingServices.QueryDesigners.GenericQueryDesigner,Microsoft.ReportingServices.QueryDesigners"/>
For more information about deploying data processing extensions, see Deploying a Data Processing Extension*.
To configure code access security for the sample
- Open the report server policy configuration file (rssrvpolicy.config). The default location for this file is C:\Program Files\Microsoft SQL Server\MSRS10.MSSQLSERVER\Reporting Services\ReportServer.
- Data processing extensions must be granted full trust. To do this, add the following code group information to the end of the code groups section in the configuration file: * <CodeGroup class="UnionCodeGroup"
Description="Code group for my FSI data processing extension">
Url="C:\Program Files\Microsoft SQL Server\MSRS10.MSSQLSERVER\Reporting Services\ReportServer\bin\Microsoft.Samples.ReportingServices.FsiDataExtension.dll"
- If you are using the sample data processing extension in Report Designer, repeat steps 1 and 2 using the Report Designer preview policy configuration file (rspreviewpolicy.config) and the following code group: * <CodeGroup class="UnionCodeGroup"
Description="Code group for my FSI data processing extension">
Url="C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\Microsoft.Samples.ReportingServices.FsiDataExtension.dll"
</CodeGroup> The default location for the rspreviewpolicy.config file is C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies.For more information about .NET Framework security and Reporting Services, see
Secure Development (Reporting Services)*.
Creating a Report That Uses FsiDataExtension
This section contains a quick walkthrough showing how to create a sample report that uses the sample data extension.
|You must deploy the sample file share data extension to Report Designer and to the report server before creating a report. You must also enable the generic query designer for the extension. For more information, see "Deploying FsiDataExtension"
earlier in this topic.
To create the report project
- Click Start, point to Programs, point to Microsoft SQL Server 2008, and then click
Business Intelligence Development Studio.
- On the File menu, point to New, and then click Project.
- In the Project Types list, click Business Intelligence Projects.
- In the Templates list, click Report Server Project.
- In Name, type FsiReportProject.
- Click OK to create the report project.
To create the report
- On the Project menu, click Add New Item.
- In the Categories list, click Report Project.
- In the Templates list, click Report.
- In the Name box, type FsiReport, and then click Open.
To add a data source that uses the sample data extension
- In the Data pane, click New, and then select New Dataset.
- On the Query tab, in the Name text box, type FsiDataSource.
- In the Type list, select File Share Information.
- Leave ConnectionString empty. The sample data extension does not use a connection string.
- On the Credentials tab, click one of the server logon types. You may enter the user name and password for the file share that your sample data extension will be accessing. Click
Use Windows Authentication (Integrated Security), click use a specific username and password, and enter credentials, or click
prompt for credentials and enter a prompt string. Security Note: Whenever possible, use Windows Authentication. You will be prompted for network credentials any time that you try to access a network file share, except when your credentials have been
- Click OK to save the data source.
To view the dataset
- In the Data view, the generic query designer is displayed. From Command Type, select
- In the query pane directly below the toolbar of the generic query designer, type the path of a network file share available on your network. For example, type
- On the toolbar of the generic query designer, click the Run (!) button. The file share data will appear in the details pane.
To design the report layout
- In the Design view, in the Toolbox, click Table.
- Drag the Table control onto the design surface.
- From the Report Data pane, drag the Name box to the first cell in the
Detail row. Add fields to the table as needed.
To preview the report
- Click the Preview tab to preview the report. Depending on your credential settings for your FsiDataSource, you may be required to enter a user name and password.
Compiling and Running Code Examples Reporting Services Samples
Extension Samples (Reporting Services) Implementing a Data Processing Extension
Help and Information
- Getting SQL Server 2008 Assistance* © 2008 Microsoft Corporation. All rights reserved.