File Share Data Processing Extension Sample
FsiDataExtension is a simple data processing extension for the Windows file system. It uses the Microsoft .NET Framework library classes DirectoryInfo and FileSystemInfo 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.
The SQL Server samples are not installed automatically during setup. For instructions about how to install the samples, see Installing Samples.
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 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 2005, including Reporting Services.
- Microsoft .NET Framework version 2.0.
- Reporting Services samples. You can choose to install the samples during SQL Server 2005 setup. For this release, when you choose to install samples, a separate installer is installed on your computer that you can launch to extract and install samples. You can run this installer from the Start menu in the Microsoft SQL Server 2005 program group.
- A report server that you have permission to access on your network, if you plan to use the sample extension to add additional data processing functionality to your server.
Location
This sample is located in the Extension Samples\FsiDataExtension Sample subdirectory of the Reporting Services samples directory.
For example:
C:\Program Files\Microsoft SQL Server\90\Samples\Reporting Services\Extension Samples\FindRenderSave Sample
Building the Sample
Use the following 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 /r:Microsoft.ReportingServices.Interfaces.dll
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.
The Add References dialog box opens.
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.
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\MSSQL.3\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 8\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 8\Common7\IDE\PrivateAssemblies, and the default location for the RSReportServer.config file is C:\Program Files\Microsoft SQL Server\MSSQL.3\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.VDTQueryDesigner,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\MSSQL.3\Reporting Services\ReportServer.
Data processing extensions must be granted full trust. To do so, add the following code group information to the end of the code groups section in the configuration file:
<CodeGroup class="UnionCodeGroup" version="1" PermissionSetName="FullTrust" Name="FSICodeGroup" Description="Code group for my FSI data processing extension"> <IMembershipCondition class="UrlMembershipCondition" version="1" Url="C:\Program Files\Microsoft SQL Server\MSSQL.3\Reporting Services\ReportServer\bin\Microsoft.Samples.ReportingServices.FsiDataExtension.dll" /> </CodeGroup>
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" version="1" PermissionSetName="FullTrust" Name="FSICodeGroup" Description="Code group for my FSI data processing extension"> <IMembershipCondition class="UrlMembershipCondition" version="1" Url="C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies\Microsoft.Samples.ReportingServices.FsiDataExtension.dll" /> </CodeGroup>
The default location for the rspreviewpolicy.config file is C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies.
For more information regarding .NET Framework security and Reporting Services, see Understanding Code Access Security in 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.
Note
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 2005, 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 Data view, from Dataset, select <New Dataset...>.
The Data Source dialog box opens.
On the General 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 you attempt to access a network file share, except when your credentials have been cached. Click OK to save the data source.
To view the dataset
In Data view, the generic query designer is displayed. From Command Type, select Text.
In the query pane directly below the toolbar of the generic query designer, type the path to a network file share available on your network. For example, type \\Computer1\Public.
On the toolbar of the generic query designer, click the Run (!) button.
The file share data should appear in the results pane below.
To design the report layout
In Layout view, in the Toolbox, click Table.
Drag the Table control onto the design surface.
From the Fields window, drag the Name box to the first cell in the Detail row. Add additional 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.
See Also
Tasks
Compiling and Running Code Examples
SQL Server Reporting Services Samples
Other Resources
Extension Samples (Reporting Services)
Implementing a Data Processing Extension
Help and Information
Getting SQL Server 2005 Assistance
Change History
Release | History |
---|---|
5 December 2005 |
|