Today, let us look at how we can submit XML Publisher report from PL/SQL. Now you might think that I already know how to use “fnd_request.submit_request” to submit a concurrent program. Right? Well, things are a little different when it comes to XML Publisher Report / Concurrent Program.
First, let us see what happens when you submit a XML Publisher Report manually from the SRS Window. Take a look at the below screen shot. You will see that the “Layout” field is populated automatically once you select the concurrent program name.
Lets click on “Options” and see what we can find out.
You will see the template name, language and format details. This is populated from the Data Template that we have created. Let us see how that looks.
So the template is linked to the concurrent program. Therefore what we learn from this is that when we submit the concurrent program manually, the layout / template is automatically attached to the Concurrent Program and that’s how the output is generated in PDF (in this example).
So when we try to submit the concurrent program from PL/SQL, it has to be a two-step process:
- Attach the layout / template to the Concurrent Program
- Submit the concurrent program
Now lets see how we can attach the layout / template to the Concurrent Program. The API to be used is fnd_request.add_layout.
You can get the template details using the below SQL statements.
SELECT * FROM xdo_templates_b
WHERE template_code = ‘FNDCPPGD_XML’;
SELECT * FROM xdo_templates_tl
WHERE template_code = ‘FNDCPPGD_XML’;
Let us also look at how we can submit the concurrent program. API for the same is fnd_request.submit_request. In our case, call to the API will look like:
So our final code snippet will look like below:
One thing to note is that if you are calling the program from another concurrent program, you may not have
to use FND_GLOBAL.APPS_INITIALIZE.
Hope this helps. Please leave your comments and feedback which will really help us!!
If you would like to see blogs on a different topic, please use the “Contact Us” page to let us know.
Questions? Comments? Suggestions? Let us know!! Like / Subscribe / Follow for more updates.