Categories
- All Categories
- 75 Oracle Analytics News
- 7 Oracle Analytics Videos
- 14K Oracle Analytics Forums
- 5.2K Oracle Analytics Idea Labs
- Oracle Analytics User Groups
- 40 Oracle Analytics Trainings
- 59 Oracle Analytics Data Visualizations
- 2 Oracle Analytics Data Visualizations Challenge
- 3 Oracle Analytics Career
- 4 Oracle Analytics Industry
- Find Partners
- For Partners
XML Report differ between tags with the same name
Summary
XML Report differ between tags with the same name
Content
Hello community,
I'm trying to create a PDF report with a XML file in the Word Template. The structure of the XML file ist not optimal but I can't change it.
The structure of the XML file is as follows:
<entity>
<phones>
<phone>
...
</phone>
<phone>
...
</phone>
</phones>
<director>
<phones>
<phone>
...
</phone>
</phones>
</director>
</entity>
Now I want to list all numbers of the entity but not the number of the director. My problem is that this does not work.
I created my repeating groups as follows:
for each entity
for each phones
for each phone
...
end
end
end
As the numbers of the director are within the entity tag they appear as well. I need something like:
for each entity
for the first phones
for each phone
...
end
end
end
Is there any possibilty to realize that in the word template of the BI Publisher?
Thanks
Answers
-
Hi,
I'm a touch confused.
When you start looping through entity and you begin your "for each phones" loop (ie entity/phones), this shouldn't include the director as the director information is under entity/director/phones. What am I missing?Either way, could there be any way you can use wildcard filtering to filter out the unwanted loop? Hard to know without seeing what other data is contained in the XML file.
If you only want to loop a certain amount of times at a certain level, you can use a variable for this. Set as 0, increment within each loop and have an exit clause.Thanks,
Adam0 -
Hello Ron,
I am familiar with the basic functions of the template builder for word. The point is that the basic repeating group does not work here as I mentioned above. I need to customize the repeating group with some code and I don't know the syntax for it.
So it would be nice if you could give me a code example exactly for that.
I'm afraid I'm not allowed to post the RTF or the XML here because it is about a confidential topic.
Greets
Niclas
0 -
Hi Adam,
the direcor/phones tag is another phones tag that is under entity. That seems to be the reason why the publisher includes it. Whether there are tags in between does not seem to matter.
Adam Wickes schrieb:
If you only want to loop a certain amount of times at a certain level, you can use a variable for this. Set as 0, increment within each loop and have an exit clause.Thats what I'm looking for but I dont know anything about the code in the publisher template builder. Can u give me a code example for that?
Thanks a lot
Niclas
0 -
Hello Niclas,
We can tell you to create a for-each based on the phones and one for the director, but i think it is best to practice and learn first before trying things you are not familiar with.
Have a look at:
https://docs.oracle.com/middleware/12211/bip/BIPRD/GUID-25D3CE26-AD11-4A0D-956B-BC2FA5D1E172.htm#BIPRD3404http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bip/tb4word/tbwordbip.htm
Also use Google. Many sites with good information.
When you know a bit more, post the RTF and the XML for better support.
Good luck.
Greets,
Ron
0 -
Niclas,
Have a look at these links.
Never name it.: XML Publisher -- Can you limit returned rows in a loop ?
https://blogs.oracle.com/xmlpublisher/wildcard-filtering-continued --> Applying a filter to your grouping based on one of the fields within that group
Hopefully they help. If you want to take a look at variables, there's some good info here.
http://adivaconsulting.com/bi-publisher/item/81-rtf-template-working-with-variables.html
As Bill mentions, it's a good idea for your own understanding to do some reading. There is plenty of information out there and many different solutions to the one question.
Is there any way you could provide us the XML and RTF with dummy data?
I work in a bank so understand the need for privacy but if you modify some sample data for us, that would be helpful.Thanks,
Adam0 -
Glad to be of help.
0 -
Hello Adam,
unfortunately the position() function did not work here. I was able to solve the problem with your third link.
I used the following code in the opening for-each field:
/*Working in a loop*/
<?xdoxslt:set_variable($_XDOCTX, ‘counter’, 0)?>
<?for-each:G1?>
/*increment the counter*/
<?if:xdoxslt:get_variable($_XDOCTX, ‘counter’) = 0?>
<?xdoxslt:set_variable($_XDOCTX, ‘counter’, xdoxslt:get_variable($_XDOCTX, ‘counter’) + 1)?>
And in the closing for-each field I added the end of the if clause:
<?end if?>
<?end for-each?>
Thanks for your help
Niclas
0