Hi @shir_Indaporker,
All JS in Retool is run in a sandbox, so a lot of window functions will not be able to escape out. Some users will use a custom component to get around this limitation. window.print() will not work in a JS query, but you should be able to get it to print the contents of a custom component when run in a custom component's script.
Otherwise, I know some folks have explored third party printing solutions - Tutorial: Making PDF's in Retool