Oracle BI Publisher provides end users with a template-based, easy-to-use publishing solution. It is based on standard, well-known technologies and tools so users can take advantage of it easily. Users will have a set of familiar tools such as Adobe and Microsoft Word/Excel to create and maintain their own report formats based on data extracts. Users will then be able to send the report outputs to destinations of choice, email, fax, printers and others.
Oracle BI publisher can be easily integrated with Oracle Application.
Basic Requirement
We need to create the visual representation of rating depending on their performance appraisal so that user can compare them at a glance. The business scenario is shown table below.
Pre-Requisite
Following are the pre-requisites for report to build and also for applicability of solution
Employees must have Performance Rating entered in the system.
We are creating the template using MS word Form Field method.
Necessary data definitions are present/created in the system.
Solution Approach
The Visual representation of User rating can be achieved in two different ways. There may be other possible ways but here we will restrict our discussion based on the creation of the template using MS word Form Field method.
1) Using MS-Word Auto Shape Feature
Here the Star shape is created using the MS-Word auto shape feature
a) Select the desired shape from Auto-Shape
b) Double click on the selected image and paste the following code in Web tab
<?for-each@shape:xdoxslt:foreach_number($_XDOCTX,1,RATING,1)?><?shape-offset-x:(position()-1)*25?><?end for-each?>
Here "RATING" is nothing but the name of XML node of Data definition.
Here for-each@shape command is used to execute the ‘for…loop’. Here initial value of the loop is 1. The final value of the loop variable is the value of ‘RATING’ variable. The loop variable will increment by 1.
When the Rating =0 ---- there will be no execution of the loop, so star shape will be displayed.
When the Rating =1 ---- the loop will execute for 1 time, so a single star will be displayed.
When the Rating =2 ---- the loop will execute for 2 time, so two star will be displayed.
When the Rating =3 ---- the loop will execute for 3 time, so two star will be displayed.
Sample output
2) Using External GIF Feature
The MS Word Auto shape supports various shapes and as we know the shapes can be changed by skewing them, stretching them, squashing them, etc. Now if the customer wants to use an image which is not available in MS Word Auto Shape then we have to use the following solution
When it is gif, the code is not straight forward as it is in case of MS word Auto Shape. We need to twist the code a bit to achieve our goal. The details are given below.
here "inline wrap" and "end" are the form field.Details of these fields are mentioned below
Field
inline wrap
Form Field Entry
<? for-each@inlines:xdoxslt:foreach_number($_XDOCTX,0,RATING,1)?>
end
<? end for-each?>
Here we have to use @inlines instead of @shape to get the image on a single row and then start the loop from 1.If the user rating is not entered in the system then it will considered as ‘0’ and no star will be displayed.When the Rating =1 only single star will be displayed, so loop needs to run from 1,1
When the Rating =3 the loop will run from 1 to 3, so 3 star will be displayed.
Conclusion:-
The BI Publisher (formerly XML Publisher) supports Microsoft drawing, Shape etc. One can use these objects to template and they will appear in final PDF output.
The following AutoShapes categories are supported.
Lines - straight, arrowed, connectors, curve, free form, and scribble
Connectors - straight connectors only are supported. Curved connectors can be achieved by using a curved line and specifying the end styles to the line.
Basic Shapes - all shapes are supported.
Block arrows - all arrows are supported.
Flowchart - all flowchart objects are supported.
Note:- The Key benefits of BI Publishers are
Þ Separation of presentation and data layer
Þ Cost reduction
Þ Control over Report Layout and High customization
Þ Different presentation tools.
Þ Output in the format of one’s choice.
Þ Tight integration with Oracle eBusiness Suite
Þ No additional third party tool.
References:-additional 1) https://metalink.oracle.com
2) Oracle XML Publishern( Release 12) B31410-01
Disclaimer:- This is a knowledge sharing site. This topic talks about a custom solution. Oracle may not provide you a support for any data corruption or any other problem in your custom code/problem arises because of the custom code. The author is not responsible for any kind of system/data problem appears because of usages of this code.Reader/implementer must do it on his/her own risk/responsibility.