The Problem: During Excel exports, event-triggered action blocks don't run. This means any setup code in events like "Before workbook opens" or "On filter change" gets skipped, potentially leaving variables uninitialized or filters unapplied.
The Solution: Create a standalone action procedure that contains all the necessary setup logic from your event blocks. Then call this procedure in two places:
In your original event blocks (like "Before workbook opens")
Directly in your report definition
This ensures the same setup code runs both when users interact with the workbook normally and when the system generates exports, guaranteeing consistent results between the filtered view and exported data.