Click here to Skip to main content
Sign Up to vote bad
good
I'm design Report with sub Report and I'm always get this Error
	Data retrieval failed for the subreport, 'SubReportZone', located at: PassesInfo.Report.SubReportZone.rdlc. Please check the log files for more information. 
 
private void Form1_Load(object sender, EventArgs e)
{
    // TODO: This line of code loads data into the 'HeaderPerson.usp_ReportPersonByID' table. You can move, or remove it, as needed.
    this.usp_ReportPersonByIDTableAdapter.Fill(this.HeaderPerson.usp_ReportPersonByID,1);
 
    this.reportViewer1.RefreshReport();
    this.reportViewer1.LocalReport.SubreportProcessing += new Microsoft.Reporting.WinForms.SubreportProcessingEventHandler(LocalReport_SubreportProcessing);
}
 
void LocalReport_SubreportProcessing(object sender, Microsoft.Reporting.WinForms.SubreportProcessingEventArgs e)
{
    if (e.ReportPath == "DeatilReport")
    {
        int Per_ID = Convert.ToInt32(e.Parameters["Per_ID"].Values[0].ToString());
 
        this.usp_GetPZonesTableAdapter1.Fill(detailPerson1.usp_GetPZones, Per_ID);
 
 // when iam puting break point on datatable i saw the retrivaed data but in desgin it says Data retrieval failed for the subreport, 'SubReportZone', located at: PassesInfo.Report.SubReportZone.rdlc. Please check the log files for more information

        e.DataSources.Add(new ReportDataSource(this.detailPerson1.usp_GetPZones.TableName, (DataTable)this.detailPerson1.usp_GetPZones));
    }
}
And i did so many research on google to try to figure it out but i get nothing
Posted 21-Sep-12 22:14pm
Dev-00011.6K
Edited 21-Sep-12 22:18pm


1 solution

Hi ,
Check this
private void Form1_Load(object sender, EventArgs e)
{
    this.usp_ReportPersonByIDTableAdapter.Fill(this.HeaderPerson.usp_ReportPersonByID,1);
//Place it First before Refresh    
this.reportViewer1.LocalReport.SubreportProcessing += new SubreportProcessingEventHandler(SubreportProcessingEventHandler);
    this.reportViewer1.RefreshReport();
 
}
void SubreportProcessingEventHandler(object sender, SubreportProcessingEventArgs e)
{
    int Per_ID = Convert.ToInt32(e.Parameters["Per_ID"].Values[0].ToString());
 
    this.usp_GetPZonesTableAdapter.Fill(DetailPerson.usp_GetPZones, Per_ID);
    e.DataSources.Add(new ReportDataSource("DetailPerson", (DataTable)this.DetailPerson.usp_GetPZones));
 
}
 
And Check this link also
http://support.microsoft.com/kb/919157[^]
Best Regards
M.Mitwalli
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Sergey Alexandrovich Kryukov 6,959
1 Prasad_Kulkarni 3,689
2 OriginalGriff 3,402
3 _Amy 3,332
4 CPallini 2,950


Advertise | Privacy | Mobile
Web01 | 2.6.130617.1 | Last Updated 22 Sep 2012
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid