none
Visual Basic local report using Reportviewer (subreport) RRS feed

  • Question

  • I have designed a report using reportviewer.  It is designed using a List report item with a subreport embeded into the list.  I have been trying to get this to work for a week.  I can get the main report to print, but where the subreport should be - I get

                         Data retrieval failed for subreport, 'Subreport2', located at:
                         Grades_andSchedules.ReportStudentInfo.rdlc.
                         Please check the log files for more information.

    The above is printed in each point in the report where the subreport should be printed.    I have some questions:

    1.  From what I can tell, I need to have subreport event handler.  To use this I will need to define the datasource in code.  Will I have to do the same for the datasource for the main report (since it seems to be working ok)?

    2.  What should the code look like to program the subreportevent handler?  I have tried many of the example on the internet but cant seem to get it to work.  All Im looking for is a sub report within the main report.  The components I have so far from Visual Studio are:

       Main report:  Report_FacultyInformation.rdlc, ProfessorsInfoDataSet.xsd, ProfessorsTableAdapter

       subreport:   ReportStudentInfo.rldc,  StudentsForProfessorDataSet.xsd, StudentsTableAdapter

    If I can get one small subreport to work -- I can use that to figure out the rest of the question I come up against.  I just cant seem to get it to work.  Any help would be greatly appreciated!!!

    Tom

    Tuesday, July 10, 2012 8:20 PM