Skip to content

Is it possible to programmatically generate and print an operational report PDF (for example a Purchase Requisition) from PL/SQL, the same way the client's own Print/Preview command does, rather than just triggering the print dialog interactively?

Answer

Yes — the underlying pattern is the same across most standard reports: create an Archive instance for the report (Archive_API.New_Instance, passing the report ID and its parameters), create a Print Job (Print_Job_API.New) targeting a printer (e.g. the user's default printer via Printer_Connection_API.Get_Default_Printer), attach the archived result to that print job (Print_Job_Contents_API.New_Instance), and finally trigger it with Print_Job_API.Print. The same four-step sequence works for other standard reports too (not just Purchase Requisition) by swapping in the relevant report ID and its own parameter set — the debug/trace output for the interactive Print command on a given screen is the way to find the exact parameter attributes a specific report expects.

← Browse Developer Studio, deployment, and upgrades questions