Report Viewer Not working on Object DataSource in VS 2010 (Local Mode) RRS feed

  • Question

  • Hi all,

    I'm really gaveup after 3 weeks of continuous try and error works to bring Report working in Reportviewer control

    the issue is simple :

    when i'm building a report based on object datasource that report is not showing any data.

    I had tried alot of ways to bring this working without any positive result, more over I had read dozens of articles on the same and i had installed Reportviewer SP1 without any benifits

    Finally I decided to build a small sample and ship it to you if you can help me out (noting that the same was working perfectly under Reportviewer 2008 )

    the sample attached contain the following :

    1- Form1 : Form containing Reportviewer control and some textboxes to initialize an object called student

    2- Class Named Student : with 4 properties (NAME, DOB, CLASS, SCORE)

    the report viewer is only showing the columns but not showing any data

    (how can I attach my project - please help me ?)

    the code is attached here :

    Imports Microsoft.Reporting.WinForms
    Public Class Form1
        Dim student As New student
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        End Sub
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Me.ReportViewer1.LocalReport.DataSources.Add(New ReportDataSource("DataSet1", Me.student))
            student.std_name = Me.txtname.Text
            student.std_dob = Me.dtp_dob.Value
            student.std_class = Me.txtclass.Text
            student.std_score = Me.txtscore.Text
        End Sub
    End Class
    Public Class student
        Implements IEnumerable
        Public Property std_name As String
        Public Property std_dob As Date
        Public Property std_class As String
        Public Property std_score As Integer
        Public Sub New()
        End Sub
        Public Function GetEnumerator() As System.Collections.IEnumerator Implements System.Collections.IEnumerable.GetEnumerator
            Return Nothing
        End Function
    End Class

    Tuesday, March 12, 2013 6:22 PM

All replies