Report > Report Assembly Classes > ReportEvents > ReportEvents.OnBeforeOpenReport
OnBeforeOpenReport(Report: IPrxReport; Var Cancel: Boolean);
Report. The regular report that generated the event.
Cancel. Indicates whether report opening is canceled.
The OnBeforeOpenReport method implements the event that occurs before opening of the regular report.
Available values of the Cancel parameter:
True. The regular report will not open.
False. The regular report will open.
If one changes selection in the data slice dimension, to which a control is bound, in the OnBeforeOpenReport event, the report (ReportEvents.OnAfterExecuteReport, ReportEvents.OnBeforeExecuteReport) and its sheets (ReportEvents.OnAfterRecalcSheet, ReportEvents.OnBeforeRecalcSheet) will be calculated twice. To avoid this feature, use the algorithm:
Disable calculation of a sheet or sheets, to which the control is bound. To do this, the IPrxControl.AutoRecalc property should be set to False.
If analytical data area is used, disable calculation of table. To do this, the IPivot.EventsEnabled property should be set to False.
Change selection in the data slice dimension.
If analytical data area is used, enable calculation of table. To do this, the IPivot.EventsEnabled property should be set to True.
Enable calculation of a sheet or sheets, to which the control is bound. To do this, the IPrxControl.AutoRecalc property should be set to True.
NOTE. If data area is used, skip steps 2 and 4.
See also: