ReportViewer "A data source instance has not been supplied for the data " problem

Discussion in 'ASP .Net Web Controls' started by Burak Gunay, Jun 14, 2006.

  1. Burak Gunay

    Burak Gunay Guest

    Hello,

    I have the following files in my project in Trap namespace

    CourseCost.vb -> basic course cost class
    DataSource.vb -> object data source class

    I have a report on my default.aspx page as follows:

    <rsweb:ReportViewer ID="ReportViewer1" runat="server"
    Font-Names="Verdana" Font-Size="8pt"
    Height="400px" Width="400px">
    <LocalReport ReportPath="Report2.rdlc"
    ReportEmbeddedResource="Report_Test.Report2.rdlc">
    </LocalReport>
    </rsweb:ReportViewer>
    <asp:ObjectDataSource ID="ObjectDataSource1" runat="server"
    SelectMethod="propcoursecost"
    TypeName="Trap.DataSource2">
    </asp:ObjectDataSource>

    Here is the definition of propcoursecost

    Public ReadOnly Property propcoursecost() As CourseCost
    Get
    'get new course cost information based on the change in
    student number
    Dim courseCost As New CourseCost

    ' assign new course cost information to course cost
    object
    With courseCost
    .crsid = "CRS123"
    .Students = 15
    .StdntCostInd = 142
    .StdntCostOpt = 156
    .Instructors = 2
    .InstructorCost = 70
    .AnnualCost = 90
    .TravelCost = 457
    .TotalCost = 2345
    End With

    ' return course cost information
    Return courseCost
    End Get
    End Property

    I set the datasource my page_load

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As
    System.EventArgs)

    ReportViewer1.LocalReport.DataSources.Add(New
    ReportDataSource("MyDS", ObjectDataSource1.ID))

    End Sub

    When I run the report I get a

    "A data source instance has not been supplied for the data source
    'Report_Test_Trap_DataSource2'. "

    I think I set this value from the smarttag of the reportviewer already
    but I am not sure if it's taking it.

    How can I fix this problem?

    Thanks,

    Burak
    Burak Gunay, Jun 14, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Chris Botha

    ReportViewer problem after deploy

    Chris Botha, Nov 16, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    6,076
    Chris Botha
    Nov 16, 2005
  2. =?Utf-8?B?QnJhZA==?=

    Reportviewer problem

    =?Utf-8?B?QnJhZA==?=, Dec 2, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    4,761
    =?Utf-8?B?QnJhZA==?=
    Feb 14, 2006
  3. =?Utf-8?B?SG91c3RvbiBMdWNpZmVy?=

    ReportViewer/ObjectDatasource Problem

    =?Utf-8?B?SG91c3RvbiBMdWNpZmVy?=, Dec 24, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    806
    =?Utf-8?B?SG91c3RvbiBMdWNpZmVy?=
    Dec 24, 2005
  4. ajso via JavaKB.com

    Problem With ReportViewer Object

    ajso via JavaKB.com, Sep 29, 2005, in forum: Java
    Replies:
    3
    Views:
    1,728
    Oliver Wong
    Sep 29, 2005
  5. Chris Botha
    Replies:
    0
    Views:
    1,691
    Chris Botha
    Dec 30, 2006
Loading...

Share This Page