REGISTER or login:
I'm trying to make it work using RUNQRY, but that only shows the query itself, not the results.
Since RUNQRY doesn't show the query and actually shows the result, your statement doesn't make much sense. Can you give a little more detail about your coding? Show us the code and describe what happens. Numerous suggestions seem likely.
If you prompt RUNQRY (press f4) -- then F9=All parameters
You will see:
Report output type . . . . . . . *RUNOPT <-- change to *PRINTER
Print query definition . . . . . *RUNOPT <-- change to *NO
You should get printer output of your query.