What do you mean by "it doesn't work properly"? It doesn't zoom well, or it doesn't work at all?
If you attach the same action to a button, does clicking the button cause the sheets to be fitted to your window area?
Take into account that a zoom like this will make all objects fit into the window area. This includes invisible objects.