Monday, April 14, 2008

Data Template Example : Passing A Parameter

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

Monday, February 25, 2008

What is the data template?

Some of you may be using an Oracle .rdf to generate your BIP reports and then attaching a .rtf layout template to it. This may be fine for your business needs at this point, but what if you could improve your report run time by 30-40%? That sounds nice, doesn't it? Well, if you were to use 'pure' BIP (which means writing your reports in XML) then it could happen. Of course every report is different, but you are putting less work on the BIP execution engine this way. This means that you have to take some time to explore XML if you don't already know it, but in the end it may speed up your reports.

The data template is how you communicate your request for data to the data engine. You write this data template in XML and the elements that you create define how the data engine will process the template and generate your XML output. A shell to create a data template looks like this :























The data template has a parameters section, a dataQuery section and a dataStructure section. Within each section there are elements. Below is a list of the elements

dataTemplate - required : declares that the xml you are writing is a dataTemplate to be used as your report.
parameters - consists of 1 or more child elements
parameter - the name of the parameter referenced in your dataQuery
lexicals - consists of 1 or more lexical elements to support flexfields
lexical - the 4 types are KFF segments, KFF, KFF where and KFF order by
dataQuery - where you write your sqlStatement elements
sqlStatement - a SQL query
link - where you link your sqlStatements together as a parent-child relationship
dataTrigger - the trigger and the event associated with it
dataStructure - required when writing and linking multiple queries
group - consists of 1 or more element elements
element - the tag name assigned to the element in the XML output

Those are the pieces of the data template that you will need to know.
In tomorrow's post, I will give you an example of a data template that is passing a parameter from a concurrent program.

Saturday, February 2, 2008

1099-MISC Continued...

Hello out there in BIP world! I have been getting comments about how I created my 1099-MISC .rtf files, so I thought I should write a follow-up to my last post.

I started off trying to download the .pdf files from the IRS website, but if you haven't noticed already, you have to write Adobe code in the .pdf docs to get the looping you want. So, that didn't work out too well for me seeing that I don't know how to code in Adobe.

The most effective way that I found to get the forms how we needed them, was to create a .rtf template to use. I was only required to create a format that we could print and mail out, which eliminated having to worry about business-2-business field compatibility and using the .pdf to send back to the IRS electronically. Basically, I just used the BIP desktop tool to re-create the IRS forms. I created 2 tables per page (one for Copy B and one for Copy 2) and then entered my for-each loops and tags accordingly.

You can download 2 sample files here :
Copy B/2
Copy C

These templates need some clean-up work with removing the table lines where they aren't needed (use the IRS downloaded forms as your guide). But you will get the overall idea on what you should use for this solution. If you have any additional questions, just post a comment and I'll get back to you.

Friday, January 11, 2008

My 1099-MISC Solution

Is anyone else having trouble using BIP to get their 1099-MISC forms how they want them? Well, at my company we previously used pre-printed triplicate forms where Copy B and Copy 2 were sent to the recipient and Copy C was kept by us (the payer). The forms caused issues with alignment on the pin feed printer and were also time consuming because they had to be torn apart. Pin feed printer? Are those still around? Anyway....

Enter XML Publisher and the laser printer solution! Oracle provides a 1099-MISC template. The seeded template (called 1099 Forms if you want to do a template search) is a .PDF template and only contains Copy B that will print 1 recipient per page. The document doesn't have IRS wording on it and would require your company to include an additional piece of paper in the envelope. This format didn't meet our needs, so BIPgirl was called upon to save the day!

What was our solution? Create new .rdf templates of course! Seeing that we've been sending recipients Copy B and Copy 2, I created 1 .rtf template with those 2 layouts on it (going by what is on the IRS website). When inserting the XML tags from the seeded report APXT7F99, I have the same recipient's information print on 1 page. I then created a second template with Copy C. In this template I have 2 recipients print per page.

But what about the IRS wording? I was hoping that you wanted to know about that. Going back to how time consuming the triplicate forms were, we didn't want to stuff extra pieces of paper into envelopes. To get around this, we contacted our paper vendor and ordered custom stock. This new stock has a perforation in the middle so that Copy B and Copy 2 can be torn apart by the recipient and folded to fit into window envelopes by us. Then we had the IRS wording printed on the back of Copy B and viola! we have our forms to mail out in our custom window envelopes. As for Copy C, we just keep them for our records so they could be printed on white paper to save on the custom stock cost.

So if anyone else is out there struggling or spending too much time dealing with pre-printed forms, try this solution. It really saved us a lot of time and money!

Thursday, January 10, 2008

Demystifying BIPgirl

OK Tim... so you tagged me! Now I have to reveal 8 things that my readers didn't know about me.

For those of you who didn't see Tim's 1/8/08 post (Oracle BI Publisher Blog) , he blog tagged me! So I'm 'It' and I have to reveal my deepest darkest secrets. Haha.. I don't think so!

  1. I am a Boston Red Sox fan and live in upstate NY.
  2. Along with my CIS degree, I also have a degree in Early Childhood Education. I decided right after I received my Early Childhood degree that I would probably prefer hanging out in a cube all day to finger painting. I still feel that way, so I guess I made the right choice!
  3. I am a cleaning fanatic. Monica on Friends... yes, that's me. Yet another reason why finger painting and I don't mix (see #2)
  4. Every night when I get home from work I get on my treadmill and run just like a hamster on a wheel. I think exercise is great for clearing your mind!
  5. I hate talking on the phone, which is weird because I remember falling asleep talking on the phone when I was a teenager. Email me, text me I'll get back to ya.
  6. I am engaged to a .net developer! Check out his sites, they're great! http://www.sivatar.com and http://www.earnmoneytoblog.com
  7. I play Halo 3 online (another good stress reliever), but I refuse to wear the headset and talk to people.
  8. What is the one thing that is guaranteed to put a smile on my face? Buddy the wonder cat

Enough about me, let's hear from some other bloggers. Here are a couple of sites that I've been to recently (sorry, I don't have 8)

1. Oracle Newbies Blog - Lisa Dobson
2. Oracle & Google Technical Blog and More - Greg Partenach
3. MattTopper.com - Matt Topper