ActiveReports 8 - Section Report With Main Report and SubReport

1.1k Views Asked by At

I am developing a Section report using ActiveReports 8. I have a Main report with a detail line that has five text boxes bound to data. The detail line also has two unbound text boxes that are defined but are not bound to data. I am attempting to populate these two unbound fields by data coming from the subreport.

I am part way there BUT the unbound fields are getting populated one detail line late. If this makes sense?

Have tried using different events ... cannot seem to find the right combination.

1

There are 1 best solutions below

0
MESCIUS Team On

You can get data from the SubReport by creating a property or two in the SubReport and access the property values in the main report's Detail Section's Format event and assign it to the unbound TextBoxes. Something like:

private void detail_Format(object sender, EventArgs e)
    {
        subReport1.Report = rpt;
        rpt.Run();
        textBox3.Text = rpt.SubReportValue.ToString();
    }
private void MainReport_ReportStart(object sender, EventArgs e)
    {
        rpt = new ChildReport();
    }

We have also replied to you on the ActiveReports forum post with a demo application - http://arhelp.grapecity.com/groups/topic/activereports-8-section-report-with-parent-and-subreport/