none
Drillthrough: A data source instance has not been supplied for the data source

    Question

  • I'm getting the dreaded "A data source instance has not been supplied for the data source" error when trying to load a drillthrough report.

    I'm using webforms and tyring to perform basic drillthrough functionality, where the main report displays a list of Reps and the drillthrough displays Rep Details. I'm using datasets that call stored procs.

    My dataset has one table. Here are the dataset details:
    File name: RepDetails.xsd
    DataTable: MyReports_GetRepDetails
    TableAdapter: MyReports_GetRepDetailsTableAdapter

    From the Report > Data Sources menu item, the datasource associated with the report file is:
    Name: RepDetails_MyReports_GetRepDetails
    Type: Database
    DataSet: RepDetails
    Table: MyReports_GetRepDetails

    Here's my drillthrought method:

    protected void ReportViewer1_Drillthrough(object sender, DrillthroughEventArgs e)
    {

    ReportViewer reportViewer = new ReportViewer();
    reportViewer.ProcessingMode =
    ProcessingMode
    .Local;
    reportViewer.LocalReport.ReportPath =
    "RepDetails.rdlc"
    ;

    DataSet ds = new DataSet("RepDetails");

    LocalReport drillthroughReport = (LocalReport
    )reportViewer.LocalReport;
    ReportDataSource dataSource = new ReportDataSource("RepDetails_MyReports_GetRepDetails", ds.Tables["MyReports_GetRepDetails"
    ]);
    drillthroughReport.DataSources.Add(dataSource);

    }

  • The exact error is "A data source instance has not been supplied for the data source 'RepDetails_MyReports_GetRepDetails'."

    Any help is greatly appreciated!!

     

Wednesday, November 08, 2006 6:06 PM

Answers

  • This line is the problem:
    LocalReport drillthroughReport = (LocalReport)reportViewer.LocalReport;
    Replace it with:
    LocalReport drillthroughReport = (LocalReport)e.LocalReport;

    Wednesday, November 08, 2006 7:21 PM

All replies

  • This line is the problem:
    LocalReport drillthroughReport = (LocalReport)reportViewer.LocalReport;
    Replace it with:
    LocalReport drillthroughReport = (LocalReport)e.LocalReport;

    Wednesday, November 08, 2006 7:21 PM
  • Thank you Rajeev! I got it to work.

    I made the change you recommended above, but I also had to add a second ObjectDataSource ("ObjectDataSource2") to the .aspx page and bind it to my RepDetails dataset. Then, in the drillthrough method, set the dataSource.DataSourceId = "ObjectDataSource2"

    So that works. Thank you.

    Wednesday, November 08, 2006 9:08 PM
  • When I try this I get the following error.

    Error 4 'Microsoft.Reporting.WebForms.DrillthroughEventArgs' does not contain a definition for 'LocalReport' C:\Projects\COM\App\User\FileName.aspx.cs 57 57 C:\...\App\
     

    I used LocalReport drillthroughReport = (LocalReport)e.Report; And it worked fine.

    Thursday, December 07, 2006 6:32 PM
  • Error I am getting Like

  • "A data source instance has not been supplied for the data source 'AnalysisDS'. "
  • Partial Class ReportViewer

    Inherits System.Web.UI.Page

    Dim myUri As Uri

    Dim strServerPath As String

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

    Try

    strServerPath = "http://webhome07/ReportServer$SQL"

    myUri = New Uri(strServerPath)

    rptViewer.ServerReport.ReportServerUrl = myUri

    rptViewer.LocalReport.ReportPath = "C:\Inetpub\wwwroot\P2TrendReportsSampleProject\P2TrendReportsSampleProject\SampleReport.rdl"

    Dim objRDS As New Microsoft.Reporting.WebForms.ReportDataSource

    'objRDS.Value = "AnalysisDS"

    'rptViewer.LocalReport.DataSources.Add(objRDS)

    rptViewer.ShowToolBar = False

    rptViewer.ServerReport.Refresh()

    Catch ex As Exception

    End Try

    End Sub

    End Class

Wednesday, February 14, 2007 6:17 AM
  • When I cut and paste this code I get the following erroor:

    reportviewer is a type and can not be used as an experession.

     

    So I am doing some thing  wrong.

    Can you help.

     

    Also do you know any books which cover using drillthrough's in great detail ??  I have looked and can not find any.

    Thanks

     

     

    Thursday, February 22, 2007 9:41 PM
  • Thank you...thank you.

    it also work for my code. i'm using an embeded report, so i modified this line (in VB):

     

    reportviewer.LocalReport.ReportPath = "Detail.rdlc"

    To

    reportviewer.LocalReport.ReportEmbeddedResource = "WinFormReport1.Detail.rdlc"

     

    still work fine!

    Tuesday, November 13, 2007 4:35 AM