Base de Conocimientos Técnicos

REPORTS: 1.To pass a value from a SubReport back to the Main Report

Hint Ref: 020601311840
Hint Date: 31/01/2006

Hint Details:

1. On the main report, select the 'Report' menu, 'Pass Setting' and set it to 'Two pass'.

2. On the main report, select the 'Calc' tab and change to the 'Module' view by right clicking in the top left window and selecting it from the list.

3. Select 'Declarations' then right-click on 'Variables' and select 'new'

4. Add a new variable such as

        MyVariable : double;

5. Select the SubReport and return the 'Calc' tab to showing 'Events' by right clicking in the top left window and selecting it from the list.

6. Locate the item you want to pass back (say DBCalc1) and create an 'OnPrint' procedure

      MyVariable : = DBCalc1.Value;

7. Place a Variable on the main report (say Variable1)

8. Select the 'Calc' tab and then 'Report' in the top left hand window. Create a procedure for 'OnStartSecondPass'

    Variable1.Value := MyVariable;