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
From the Report > Data Sources menu item, the datasource associated with the report file is:
Here's my drillthrought method:protected void ReportViewer1_Drillthrough(object sender, DrillthroughEventArgs e)
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"]);
The exact error is "A data source instance has not been supplied for the data source 'RepDetails_MyReports_GetRepDetails'."
Any help is greatly appreciated!!
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.
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.
Error I am getting Like
- "A data source instance has not been supplied for the data source 'AnalysisDS'. "
PartialClass 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
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.ServerReport.Refresh()Catch ex As Exception End Try End Sub
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.
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"
reportviewer.LocalReport.ReportEmbeddedResource = "WinFormReport1.Detail.rdlc"
still work fine!