ReportEvents.OnBeforeOpenReport

Syntax

Sub OnBeforeOpenReport(Report: IPrxReport; Var Cancel: Boolean);

Begin

// set of operators

End Sub OnBeforeOpenReport;

Parameters

Report - the regular report that has generated the event.

Cancel - this parameter determines report opening. When this parameter is set to True, the regular report is not opened, when it is set to False, the report is to be opened.

Description

The OnBeforeOpenReport method implements the event that occurs before opening of the regular report.

Comments

If selection in the data slice dimension, to which a control is bound, is changed in the OnBeforeOpenReport event, the (ReportEvents.OnAfterExecuteReport, ReportEvents.OnBeforeExecuteReport) report and its sheets (ReportEvents.OnAfterRecalcSheet, ReportEvents.OnBeforeRecalcSheet) are calculated twice. To avoid this feature, use the algorithm:

  1. Disable calculation of a sheet or sheets, to which the control is bound. To do this, set the IPrxControl.AutoRecalc property to False.

  2. If analytical data area is used, disable calculation of table. To do this, set the IPivot.EventsEnabled property to False.

  3. Change selection in the data slice dimension.

  4. If analytical data area is used, enable calculation of table. To do this, set the IPivot.EventsEnabled property to True.

  5. Enable calculation of a sheet or sheets, to which the control is bound. To do this, set the IPrxControl.AutoRecalc property to True.

NOTE. If a standard data area is used, skip steps 2 and 4.

See also:

ReportEvents