Where_clause for pdf

Hi all,
I was asked urgently to solve a question that I thought was simpler.

I have to make exportable, both in pdf and in csv, only the records that have the approved field = 1 (of a custom module). This works very well for csv exports by customizing the function create_export_query function:

$where_auto = "( my_module.deleted IS NULL OR my_module..deleted=0 ) AND my_module_cstm.approvazione_c=1";

but pdf seems to ignore this condition.

Where should I enter it for pdf?

Thanks so much for any help!