Attach file to current doctype (Code way)

I have a small doctype that is called to schedule an small report, this report is generated as HTML, how I can attach files to the current doctype in the code?

Haven’t seen any of your contributions yet!