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

Event Load Cannot be Found

1 Answer 214 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Dev111
Top achievements
Rank 1
Dev111 asked on 23 Feb 2014, 04:57 AM
I am adding a stored procedure event and using the code below which I got from another thread about stored procedures and fit it for my needs.  Unfortunately, I am getting errors on the (.Load).  The error says "Event Load Cannot be Found" and IsPostBack is not declared.

Any help would be appreciated.  The code I am using is below.  Also, if you see any other errors with the code let me know, thanks.

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
 
        If Not IsPostBack = False Then
            Dim myReport As New Report1()
 
            Dim sql = "[dbo].[spMBUser]"
            Dim connectionString = "Data Source=MyServer;Initial Catalog=NDB;Integrated Security=True"
            Dim command As New SqlCommand(sql, New SqlConnection(connectionString))
            command.CommandType = CommandType.StoredProcedure
 
            Dim sqlparam As New SqlParameter("@uval", SqlDbType.NVarChar)
            sqlparam.Value = 3
            command.Parameters.Add(sqlparam)
 
            Dim adapter As New SqlDataAdapter(command)
            Dim dataSet As New DataSet()
            adapter.Fill(dataSet)
 
            myReport.DataSource = dataSet.Tables(0)
 
            Dim reportSourceInstance1 As New InstanceReportSource()
            reportSourceInstance1.ReportDocument = myReport
            reportSourceInstance1.Parameters.Add("uval", HttpContext.Current.User.Identity.Name)
            ReportViewer1.ReportSource = reportSourceInstance1
 
 
        End If
    End Sub

1 Answer, 1 is accepted

Sort by
0
Squall
Top achievements
Rank 1
answered on 24 Feb 2014, 02:08 PM
The Telerik.Reporting.Report doesn't have a Load event. The code snippet is taken from the Web Forms Page sub class. Thus you should use the Page.Load event. For this enter in the Web Page code view and handle the Page.Load event as you have shown in the code snippet.

For more info see:
http://msdn.microsoft.com/en-us/library/ms178472.aspx
http://www.telerik.com/help/reporting/report-events.html
Tags
General Discussions
Asked by
Dev111
Top achievements
Rank 1
Answers by
Squall
Top achievements
Rank 1
Share this question
or