Parent - Child - Grandchild report

  • Has this never been done before?

    Hi,

    I'm not sure if this is the right forum, so please tell me which one I should post in if this is not relevant here.

    I am designing a report using the Report Designer in Visual Studio 2010 and creating an RDLC report layout. I thne display the report using the ReportViewer control on a XAML form.

    My problem is that I need to have a subreport with its own subreport added to my main report. I've got the data displaying for the child subreport in the main report fine, but I am unsure how to hook the grandchild's subreport into the processing loop so I can fill the dataset based on the child's data. This is my code to get the Child data:

    In my ReportViewer_Load() I have this:

    // Add a handler for the SubreportProcessing event

    _reportViewer.LocalReport.SubreportProcessing += new SubreportProcessingEventHandler(LocalReport_SubreportProcessing);

    And that code refers to this:

    private void LocalReport_SubreportProcessing(object sender, SubreportProcessingEventArgs e)

    {

    Guid rct_PK = new Guid(e.Parameters[0].Values[0]);

    SamaanSystems.IBC.WPF.DataSets.ReceiptsByPeriodTableAdapters.ReceiptDetailsSelectByReceiptPKForReceiptReportTableAdapter receiptDetailTableAdapter

    = new SamaanSystems.IBC.WPF.DataSets.ReceiptsByPeriodTableAdapters.ReceiptDetailsSelectByReceiptPKForReceiptReportTableAdapter();

    receiptDetailTableAdapter.Fill(dataset.ReceiptDetailsSelectByReceiptPKForReceiptReport, rct_PK);

    e.DataSources.Add(new ReportDataSource("dsReceiptDetails", dataset.Tables[1]));

    }

    How would I handle a similar subreport processing for the grandchild?

Viewing 0 posts

You must be logged in to reply to this topic. Login to reply