none
A data source instance has not been supplied for the data source "VisitCountByDayWeekMonth_VisitCountByDayWeekMonth". RRS feed

  • Question

  • I am getting this error from a long time. I have searched internet and found that many people have solved this issue... but I am not able to solve it. here is what I have done. 1. Set the data source on the report viewer control. In this screen it shows ObjectDataSource1

    2. In my page load method I have written the following code

     

    Me.ObjectDataSource1.SelectParameters("CustomerID").DefaultValue = CustomerId
    Me.ObjectDataSource1.SelectParameters("GroupType").DefaultValue = "day"
    Me.ObjectDataSource1.SelectParameters("StartDate").DefaultValue = Me.TextBoxStartDate.Text
    Me.ObjectDataSource1.SelectParameters("EndDate").DefaultValue = Me.TextBoxEndDate.Text
    Me.ObjectDataSource1.DataBind()
    Dim custIDParam = New ReportParameter("CustomerID", CustomerId)
    Dim groupTypeParam = New ReportParameter("GroupType", "day")
    Dim startDateParam = New ReportParameter("StartDate", TextBoxStartDate.Text)
    Dim endDateParam = New ReportParameter("EndDate", TextBoxEndDate.Text)
    Me.ReportViewer1.LocalReport.DataSources.Add(New ReportDataSource("VisitCountByDayWeekMonth_VisitCountByDayWeekMonth", Me.ObjectDataSource1))
    Me.ReportViewer1.LocalReport.SetParameters(New ReportParameter() {custIDParam, groupTypeParam, startDateParam, endDateParam})
    Me.ReportViewer1.DataBind()

     

     

     


    3. when I open my rdlc file and go into Reports->DataSources. I see VisitCountByDayWeekMonth_VisitCountByDayWeekMonth as the data source.

    Can you tell me what I am missing ... because I seem to have done all the steps I could find on the net? Thanks a lot for your help in advance!

    Sunday, January 10, 2010 7:47 PM

Answers

  • I solved the issue. When creating the DataSet, I have to choose TableAdapter and then the StoredProcedure. Initially I had clicked on query->Stored procedure rather than TableAdapter->Stored procedure.

    After I deleted the existing dataset, and built a new one with Tableadapter and then Stored Procedure, things worked fine.

    Thanks a lot for your help!

    • Marked as answer by MSDN Student Monday, January 11, 2010 11:56 AM
    Monday, January 11, 2010 11:50 AM

All replies

  • The DataBind method on the ReportViewer does not do anything.  It's inherited from the base class and is not used.  When you create a new ReportDataSource, have you tried passing in the ID of ObjectDataSource1 rather than the instance itself?
    Monday, January 11, 2010 6:17 AM
    Moderator
  • I solved the issue. When creating the DataSet, I have to choose TableAdapter and then the StoredProcedure. Initially I had clicked on query->Stored procedure rather than TableAdapter->Stored procedure.

    After I deleted the existing dataset, and built a new one with Tableadapter and then Stored Procedure, things worked fine.

    Thanks a lot for your help!

    • Marked as answer by MSDN Student Monday, January 11, 2010 11:56 AM
    Monday, January 11, 2010 11:50 AM