ComponentOne Reports for WinForms Designer Edition: ComponentOne Reports for WinForms > Reports for WinForms Task-Based Help > Reporting Task-Based Help > Modifying Subreports > Retrieving Values from Subreports

Retrieving Values from Subreports

In some cases you may want to pass data from the subreport back to the main report. Script variables can't be used for this because each report has its own script scope (this avoids the possibility of conflicting variable names).

To pass data from a subreport back to the main report, you have to store values in subreport fields or in the subreport's Tag property, then have the main report read those values.

In this sample, the subreport calculates the average unit price per product category and stores that value in its Tag property. The main report retrieves and displays that value.

* Sample Report Available

For the complete report, see report "15: Retrieve Values from Subreports" in the CommonTasks.xml report definition file, which is available for download from the CommonTasks sample on the ComponentOne HelpCentral Sample page.


Send comments about this topic to ComponentOne.
Copyright © ComponentOne LLC. All rights reserved.