The most likely reason is that in this line you didn't type the dataset name
exactly:
[quoted text, click to view] > new ReportDataSource("DetailDatasetName", DT));
Open the destination report using Notepad and verify that the dataset name
is exactly as you entered.
You shouldn't have to set the parameter value manually because the main
report is already passing it to the drillthrough report.
--
Rajeev Karunakaran [MSFT]
Microsoft SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
[quoted text, click to view] <pdxfilter-google@yahoo.com> wrote in message
news:1114545468.674791.88570@g14g2000cwa.googlegroups.com...
> We're trying to implement a simple "proof-of-concept" drillthrough
> report where a list of master records can be drilled into supporting
> detail. We have this set up and working through the designer and would
> like to programatically implement the functionality using ReportViewer.
>
> We are displaying the main report without issues and have trapped the
> Drillthrough event as follows:
>
> void Drillthrough(object sender, DrillthroughEventArgs e) {
> // Load the drillthrough report from a stream
> FileStream FS = File.Open("DetailReport.rdl", FileMode.Open);
> e.Report.LoadReportDefinition(FS);
> FS.Close();
> // Get the master record the user drilled into
> ReportParameterInfoCollection Params =
> e.Report.GetParameters();
> int Key = int.Parse(Params[0].Values[0]);
> // This works - we get the identity key of the master record here
> DataTable DT = new DataTable();
> new SqlDataAdapter(
> "SELECT DetailFields FROM Detail WHERE Master=" + Key.ToString(),
> "ConnectString").Fill(DT);
> // Works - we get correct data here
> reportViewer1.LocalReport.DataSources.Add(
> new ReportDataSource("DetailDatasetName", DT));
> // Not sure we need to manually set this param?
> e.Report.SetParameters(new ReportParameter[]
> {new ReportParameter("MasterParam", Key.ToString(), false)});
> }
>
> Everything _seems_ in place, but when drilling in, we get the following
> error:
>
> "A parameter or data source credential is missing a value. Prompting
> for this value has been disabled. Supply a value or enable prompting."
>
> I've checked for obvious problems. Any ideas?
>