Writing reports using a finite state machine [1]