Update report viewer before print out

Hi,

I would like to run this script that will update 3 properties on Report Viewer and then print out the report.
However, I am getting print out before the custom properties are updated.

Can’t paste script. So pasted as photo.

But in general I am getting data from 2 entries and then tried to print report Viewer.

Regards
Pawel