Wrox Programmer Forums
BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7
This is the forum to discuss the Wrox book Professional SQL ServerReporting Services by Paul Turley, Todd Bryant, James Counihan, George McKee, Dave DuVarney; ISBN: 9780764568787
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old July 14th, 2004, 07:05 AM
Authorized User
Join Date: Jun 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Custom Assemblys

I am currently getting a "#Error" on a field of my report in which I call a Function in my Custom Assembly(ie.Corporate.Employee.GetEmployeeName(!Fi eld.EnteredBy.Value)).
[u]Works correctly in the Preview window</u>, but I get the #Error when I either deploy to a browser or select debug.

Let me give you a recap of everything I did.
(Please Note:I am using the 120 day eval. version.)
1. I setup my Report Server to run on my machine.
2. the databases I pull from when I create my datasets, come from stored procedures on our network server(on a different box).
3. I created a custom assembly under wwwroot/MyAssemblys/ on my machine that accesses the database on the network server using a stored procedure that returns a string for employee name when I a supply unique id to it.(this was tested and works)
Public Shared Function getEmployeeName(ByVal intEmployeeID As Integer) As String
        Dim strConnectionString2 As String = "data [email protected]@@@@; initial [email protected]@@@@; integrated security=SSPI"
        Dim connCorpDB2 As New SqlClient.SqlConnection(strConnectionString2)

        Dim ds As DataSet = New DataSet
        Dim da As New SqlClient.SqlDataAdapter
        Dim sqlSelect As New SqlClient.SqlCommand
        da.SelectCommand = sqlSelect

        Dim strEmployeeName As String

        sqlSelect.CommandText = "dbo.[usp_Select_tblEmployeeId_Name]"
        sqlSelect.CommandType = System.Data.CommandType.StoredProcedure
        sqlSelect.Connection = connCorpDB2

        sqlSelect.Parameters.Add(New System.Data.SqlClient.SqlParameter("@intEmployeeID ", System.Data.SqlDbType.Int, 4))
        sqlSelect.Parameters("@intEmployeeID").Value = intEmployeeID

        If ds.Tables(0).Rows.Count > 0 Then
            strEmployeeName = ds.Tables(0).Rows(0).Item("FirstName") & " " & ds.Tables(0).Rows(0).Item("LastName")
            strEmployeeName = "No name found"
        End If
        Return strEmployeeName

    End Function
4. I created my report project under wwwroot/MyReports/
5. I compiled my custom Assembly
6. I put my custom Assembly in C:\Program Files\Microsoft SQL
Server\80\Tools\Report Designer and
   C:\Program Files\Microsoft SQL Server\MSSQL\Reporting
Services\ReportServer folders.
7. I added the <CodeGroup> element to the rssrvpolicy.config located in the C:\Program Files\Microsoft SQL Server\MSSQL\Reporting
Services\ReportServer folder and I saved it.
      Name="My Custom Assembly"
      Description="Code Group for my custom extension">
           Url="C:\Program Files\Microsoft SQLServer\MSSQL\Reporting Services\ReportServer\bin\MyAssembly.dll"
8. I added a reference in my report to the C:\Program Files\Microsoft SQL Server\MSSQL\Reporting Services\ReportServer\MyAssembly.dll from
   my report.
9. I added the call to my custom assembly from my report field(ie.Corporate.Employee.GetEmployeeName(!Field .EnteredBy.Value))
10. I compiled the report and viewed in Preview window. I looked great. It did everything as it should have. But only one problem.
11. I right clicked on the report, clicked deploy and run and then I got the #Error on the one field I use the custom assembly.

I tried to give anyone willing to help me, enough information.:) If anyone could help me with this I thank you in advance.

Old July 15th, 2004, 10:53 AM
Registered User
Join Date: Jun 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts

Hi dillig,
You are having the exact problems I am. I haven't gotten it work yet in the reportserver environment. The preview tab in ReportDesigner looks fine, but in the Popup Preview mode I get the infamous #error. I'm calling a C# assembly that is accessing an Oracle database and getting an output param back.

I've got my code group added to both the rssrvpolicy.config (which you don't need for ReportDesigner) and in rspreviewPolicy.config. (by the way, you don't mention this file in your post -- you need to add the code group here for the popup preview in RD to work).

By futzing with where I put my code group in the rspreviewpolicy.config file, I've gotten the error message in Output to go from:

The value expression for the textbox ‘textbox7’ contains an error: Security Error.


The value expression for the textbox ‘textbox7’ contains an error: Request failed.

By the way, I'm working with the released copy of RS from our vendor, not the eval copy. However, that code group above your entry in your example does not ship with the released version. Somewhere I read that you need to put you code group below this entry, just like you did. I'm not sure what this means, other than it just adds to the general confusion

Please let me know if you learn anything. This situation in incredibly frustrating.



Old July 15th, 2004, 10:59 AM
Authorized User
Join Date: Jun 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts

As soon as I find out about how to get the report to deploy to a browser I will let you know.
I just loaded the full developer version on my PC.

Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom Server Control....Custom Property Editor ZArrinPour ASP.NET 1.0 and 1.1 Basics 1 June 15th, 2010 11:30 AM
Web Service, Custom Control, Custom Return Type robzyc ASP.NET 2.0 Basics 6 June 10th, 2008 08:03 AM
custom control inside custom control issues StevesonD ASP.NET 2.0 Professional 1 February 19th, 2008 06:54 PM
Implementing Custom Assemblys dillig BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 1 September 8th, 2004 07:56 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.