In my last post, I said that I would give you an example of a data template that is passing a parameter from a concurrent program. I said I would do it “tomorrow” but “tomorrow” turned into month and a half. Time sure flies when you’re having fun converting reports over to BIP! So here is a little example that I threw together …
This report is just going to pull back concurrent program information based on the reporting group that you enter as a parameter (nothing fancy, but you’ll see how the data template works).
Step 1 – Create your concurrent program
In the concurrent program I added 1 parameter called “REQUEST_GROUP_NAME” that is just a 30 char field where you will enter the reporting group name at runtime. For the executable, I used XDODTEXE. This is a java concurrent program and it is very important that you use this executable when writing your own data definition or else it won’t run. It is also important to set the output type to XML.
Step 2 – Add your concurrent program to a request group
For this example I just chose a request group that I was currently working in.
You can, of course, put your report wherever you need to.
Step 3 – Create your Data Template
I used jDeveloper to create my data template, but you can use
whatever text editor you choose. It is important that you include all
of the mandatory pieces of the Data Template or else it will error
out on you. Here is the example data template that I created, which
has my parameter name from the concurrent program and also the
query that is using the parameter. At the bottom there is a data structure
section where you will define your grouping, just like in the .rdf.
Step 4 – In this step you will create your Data Definition in the XML Publisher
Administrator responsibility. The data definition is linked to your concurrent
program, so you have to be sure your “CODE” matches the concurrent program
short name exactly.
In the Data Definition, there is an option to add your data template file at the
bottom of the screen. If you click on this button you can browse to your data
template file and upload it. Your data will now be fetched based on this data
template, not a .rdf.
Step 5 – Run your concurrent request
With the data template attached, you should be able to run your concurrent
request and view XML output. When you see this output, you should save the
file as .xml for use in your layout template design. Here is what my sample
XML data looks like :
Step 6 – Create your layout template in Word
In Word, load the sample XML data that you just saved and create your layout
template. For this example I created a very minimal template to display the data.
Step 7 – Create the Template Definition
Once you have previewed your layout template in Word and are happy with it,
you can go ahead and create a template definition and upload the template .rtf.
Step 8 – Run your concurrent request (again)
This time you will see that the layout template is attached to the concurrent
request, due to the template definition creation. When you view the output,
you shouldn’t see the XML data anymore, but the data and template merged
in report format
There you have it… a report written using a data template instead of a .rdf. Of course our reports tend to be a little more complex than this one, but a simple nonsense report is a great way to start and get some results out of the Apps.
This time I’m not making and promises about posing “tomorrow” but I haven’t disappeared (thanks Greg for checking on me)!
- BIPgirl











5 comments:
Hi,
I am really interested in developing some reports using MS Excel. I always see all the examples using RTF templates and MS Word. Even Oracle documentation gives an example using MS Word. Frankly I have not seen any company develop reports in Word.
I would like to know if XML Publisher is the best way to develop reports (we have EBS R12) and if so how can I develop some wicked Excel reports and get a promotion in my company?
Cheers
VJ
Hello:
Can I use a different code for the template definition or do I have to use the same code in the template definition as the data definition ?
Your template definition is linked to whatever data definition you want. You have to put the data definition name in the Data Definition field when you set up the template definition... this is what links the template to the data.
Hi,
I have a requirement where I have to mimic the functionality of place holder columns in RDF using Data Templates in XML Publisher.
How can I call a pl/sql function at element level when we try to group records in the data template.
To make it simple , let us say I have a requirement to retrieve the address of an employee(address line 1,address line 2, city,country)
In RDF what I do is define 4 place holder columns to capture address attributes, and in a formula column I set values to these attributes. How do I implement this in XML Publisher data template.
Cheers,
Girish M.
I tried a similar example and ended up with the error
XML document must have a top level element. Error processing resource.
Would you shed some light on what I might be doing wrong.
Thanks.
Post a Comment