[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

08/12/2009 at 11:25AM PDT, ID: 24647416
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.8

Reporting Services dll - Type not defined

Asked by jay-are in MS SQL Reporting, Microsoft Visual Basic.Net, Programming for ASP.NET

Tags: reportingservices.wsdl, reporting services

Hello Experts

My setup:
VS08
RS08/RS05 (have both)
asp.net/vb.net (webforms)
SQL08

I've got a reportviewer control on my aspx page.  I'm trying to control the datasource used in a report  depending on which user uses the page.  To do this I added a web reference for the reporting services dll.  I think.  I tried connecting to my 2008 RS server but it couldn't find any dll's for me to reference.  So I connect to the 2005 RS server via the directions on an msdn page and it works.  I add a "reportingservices.wsdl" to my App_WebReferences.  No errors in VS once I add the code to reference the datasources.  However, once I load the aspx page in my browser I get the following error:

Compiler Error Message: BC30002: Type 'ReportingService' is not defined.

Source Error:

 

Line 35:         ReportViewer1.ShowCredentialPrompts = False
Line 36:         ReportViewer1.ServerReport.ReportServerCredentials = New MyReportServerCredentials
Line 37:         Dim rs As New ReportingService
Line 38:         rs.Credentials = System.Net.CredentialCache.DefaultCredentials
Line 39:         Dim reference As New DataSourceReference()
 

Source File: C:\inetpub\wwwroot\New\GM\GM.aspx.vb    Line: 37

I've tried to do a lot of things but I'm sure this is a simple problem.  I don't fully understand how to reference a dll properly or how to use the correct namespace/imports for it.  Hopefully someone has some other ideas and not just post a link to gotreportviewer.com.  
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
aspx.vb:
 
Imports System.Web.Services
Imports System.Web.UI
Imports Microsoft.Reporting.WebForms
Imports System
Imports System.Net
Imports System.Configuration
Imports System.Collections
Imports System.Web.Security
Imports System.Security.Principal
Imports System.Web.UI.WebControls
Imports System.Web.UI.WebControls.WebParts
Imports System.Web.UI.HtmlControls
Imports System.Web.Services.Protocols
Imports System.Web.Services.Protocols.SoapHttpClientProtocol
Imports ReportingServices
Public Class GM
    Inherits System.Web.UI.Page
    
    Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim ReportViewer1 As ReportViewer = New ReportViewer
        ReportViewer1 = Me.ReportViewer1
        form1.Controls.Add(ReportViewer1)
        ReportViewer1.Reset()
        ReportViewer1.ProcessingMode = ProcessingMode.Remote
        ReportViewer1.Visible = True
        ReportViewer1.ServerReport.ReportServerUrl = New System.Uri("http://192.168.0.20/ReportServer")
        ReportViewer1.ServerReport.ReportPath = "/Folder/reportname"
        ReportViewer1.ShowCredentialPrompts = False
        ReportViewer1.ServerReport.ReportServerCredentials = New MyReportServerCredentials
        Dim rs As New ReportingService
        rs.Credentials = System.Net.CredentialCache.DefaultCredentials
        Dim reference As New DataSourceReference()
        reference.Reference = "/MyDSFolder"
        Dim dataSources(1) As DataSource
        Dim ds As New DataSource()
        ds.Item = CType(reference, DataSourceDefinitionOrReference)
        ds.Name = "MyDS"
        dataSources(0) = ds
            Dim Menu1 As Menu
            Menu1 = Me.Menu1
            Dim value As MenuItemBindingCollection
            value = Menu1.DataBindings
            'Me.Page.DataBind()
            'bunch of asp.menu stuff here
    End Sub
End Class
Public NotInheritable Class MyReportServerCredentials
    Implements IReportServerCredentials
 
    Public ReadOnly Property ImpersonationUser() As WindowsIdentity _
            Implements IReportServerCredentials.ImpersonationUser
        Get
 
            'Use the default windows user.  Credentials will be
            'provided by the NetworkCredentials property.
            Return Nothing
 
        End Get
    End Property
 
    Public ReadOnly Property NetworkCredentials() As ICredentials _
            Implements IReportServerCredentials.NetworkCredentials
        Get
 
            'Read the user information from the web.config file.  
            'By reading the information on demand instead of storing 
            'it, the credentials will not be stored in session, 
            'reducing the vulnerable surface area to the web.config 
            'file, which can be secured with an ACL.
 
            'User name
            Dim userName As String = _
                ConfigurationManager.AppSettings("MyReportViewerUser")
 
            If (String.IsNullOrEmpty(userName)) Then
                Throw New Exception("Missing user name from web.config file")
            End If
 
            'Password
            Dim password As String = _
                ConfigurationManager.AppSettings("MyReportViewerPassword")
 
            If (String.IsNullOrEmpty(password)) Then
                Throw New Exception("Missing password from web.config file")
            End If
 
            'Domain
            Dim domain As String = _
                ConfigurationManager.AppSettings("MyReportViewerDomain")
 
            If (String.IsNullOrEmpty(domain)) Then
                Throw New Exception("Missing domain from web.config file")
            End If
 
            Return New NetworkCredential(userName, password, domain)
 
        End Get
    End Property
 
    Public Function GetFormsCredentials(ByRef authCookie As Cookie, _
                                   ByRef userName As String, _
                                   ByRef password As String, _
                                   ByRef authority As String) _
                                   As Boolean _
       Implements IReportServerCredentials.GetFormsCredentials
 
        authCookie = Nothing
        userName = Nothing
        password = Nothing
        authority = Nothing
 
        'Not using form credentials
        Return False
 
    End Function
End Class
 
The reference for the RV control on the aspx page:
<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
    Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
 
The web.config:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.web>
    <customErrors mode="Off" />
    <compilation debug="true" />
    <httpHandlers>
      <add verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    </httpHandlers>
  </system.web>
  <appSettings>
    <add key="MyReportViewerUser" value="administrator" />
    <add key="MyReportViewerPassword" value="pass" />
    <add key="MyReportViewerDomain" value="192.168.0.103" />
  </appSettings>
    <system.webServer>
      <validation validateIntegratedModeConfiguration="false" />
        <handlers>
            <add name="Reserved.ReportViewerWebControl.axd_*" path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" preCondition="integratedMode,runtimeVersionv2.0" />
        </handlers>
    </system.webServer>
  <connectionStrings>
        <remove name="LocalSqlServer" />
        <add connectionString="Server=192.168.0.103;Database=Customers;User ID=sa;Password=pass" name="192.168.0.103" />
        <add connectionString="Server=192.168.0.103;Database=master;User ID=sa;Password=pass" name="LocalSqlServer" />
    </connectionStrings>
</configuration>
 
Keywords: Reporting Services dll - Type not defined
 
Loading Advertisement...
 
[+][-]08/12/09 12:17 PM, ID: 25081850

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/12/09 12:18 PM, ID: 25081864

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: MS SQL Reporting, Microsoft Visual Basic.Net, Programming for ASP.NET
Tags: reportingservices.wsdl, reporting services
Sign Up Now!
Solution Provided By: shahprabal
Participating Experts: 1
Solution Grade: A
 
 
[+][-]08/12/09 12:31 PM, ID: 25082004

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/12/09 12:33 PM, ID: 25082021

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/12/09 01:53 PM, ID: 25082859

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/14/09 09:22 AM, ID: 25099816

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08/17/09 07:39 AM, ID: 25114845

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/17/09 10:02 AM, ID: 25116233

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-91 - Hierarchy / EE_QW_3_20080625