This is a migrated thread and some comments may be shown as answers.

Reference to a non-shared member

2 Answers 72 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Randy
Top achievements
Rank 1
Randy asked on 13 Jul 2011, 02:05 PM
Hello,

I am testing the dynamic filtering capabilities of the reporting tool for asp.net.

I cut the example below from your website, bur I am getting an error with
the "Reports1.Filters.add("filter1") line. The error I get is:

<< Reference to a non-shared member requires an object reference. >>

What object requires referencing?

Thanks,
Randy


Imports System
Imports System.Data
Imports System.Data.SqlClient
Imports System.Math
Imports System.IO
Imports System.Web.UI.Control
Imports System.Net.Mail
Imports System.Globalization
Imports System.DateTime
Imports System.Threading
Imports System.String
Imports Telerik.Reporting
Imports KonsItemsTelerik
Imports Telerik.ReportViewer.WebForms
  
  
Partial Class _Default
    Inherits System.Web.UI.Page
  
    Public Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
  
        Dim filter1 As New Telerik.Reporting.Data.Filter
  
        filter1.Expression = "=Fields.ProductID"
        filter1.Operator = Telerik.Reporting.Data.FilterOperator.Equal
        filter1.Value = "=10"
  
        Report1.Filters.add("filter1")
  
    End Sub
  
End Class

2 Answers, 1 is accepted

Sort by
0
Massimiliano Bassili
Top achievements
Rank 1
answered on 13 Jul 2011, 03:04 PM
Is Report1 a public property exposing your report from the class library or an instance of the report you have created previously? If not, then the error is pretty darn correct - ask yourself, what is Report1 in your Page_Load event handler?

Cheers!
0
Randy
Top achievements
Rank 1
answered on 13 Jul 2011, 03:16 PM
I figured it out. The code snippets from the company website are a little thin and I had to fumble around to define Report1 properly

Thanks,
Randy
Tags
General Discussions
Asked by
Randy
Top achievements
Rank 1
Answers by
Massimiliano Bassili
Top achievements
Rank 1
Randy
Top achievements
Rank 1
Share this question
or