Hi,
The solution of adding key/value in the system parameters solves a different issue: your report prints without any formating (CSS).
If your reports print without the header and the footer, check the log (error_level = debug). You will certainly view such messages:
WARNING databasename odoo.addons.base.models.ir_actions_report: wkhtmltopdf: b"The switch --header-spacing, is not support using unpatched qt, and will be ignored.The switch --header-html, is not support using unpatched qt, and will be ignored.The switch --footer-html, is not support using unpatched qt, and will be ignored.QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-odoo16'\n"
To solve the problem you have to patch your wkhtml2pdf
Type this command to get the current version
# wkhtmltopdf --version
wkhtmltopdf 0.12.5
After patching your library, you will get the following response
# wkhtmltopdf --version
wkhtmltopdf 0.12.5 (with patched qt)
This will solve the problem.