« My journey with BI Publisher... | Main | Bursting: Conditional delivery »

Bursting...

During these years with Publisher, I worked with many clients directly/indirectly to resolve there reporting issues and one of the very common requirment is about generate mutilple outputs against the single process/report. Here I am sharing one such requirment...

The company’s billing system generates around 30 thousands invoices/bills for each billing cycle. Each billing cycle correspond to a single process and generate a huge set of data for all the invoices.

The process, further consume this huge data and generate the individual Invoices. i.e. one report and multiple output.

The individual Invoice layout depends upon the recipient’s country and local preference, So it could be multiple templates and multiple local. .

The process should take care of document delivery as well. Delivery type and the destination depend on individual client’s preference. Beside it, a copy of each invoice should be save to specific file location or transferred to content management system. To achieve this, the process should allow to hook custom APIs/Logic before and after individual documents generation.

Beside the individual output, there should be another single consolidated output against the same set of data. i.e. a summary report.

So what do you think, Can we satisfy this requirement against the single process?

Yes, The Bursting take care of such type of requirements where single dataset, multiple conditional layouts/templates, multiple layout, multiple delivery and the listener to hook the custom logic at each stage of process.

There are two type of bursting implementation within BI Publisher. The Control File based bursting, which is well integrated with EBS and JDE and available through Public APIs as well. The other one is Delivery SQL based bursting, which is part of Enterprise Release. We will discuss the first one on this post.

The Bursting Control file holds the Meta Data or the bursting rules in XML format.Lets have a look on following control file and see, how far it satisfies the above requirement.

<?xml version="1.0" encoding="UTF-8"?>
<xapi:requestset xmlns:xapi="http://xmlns.oracle.com/oxp/xapi">
 <xapi:globalData location="stream">
 </xapi:globalData >
    <xapi:request select="/DATA/LIST_DEPT/DEPT/LIST_EMPLOYEE/EMPLOYEE">
 <xapi:delivery>
  <xapi:email server="${EMAIL_SERVER}" port="${EMAIL_PORT}" from="${FROM_EMAIL_ADDRESS}"
    reply-to ="${REPL_TO_ADDRESS}">
 <xapi:message id="123"  to="${TO_EMAIL_ADDRESS}" cc="${CC_EMAIL_ADDRESS}" 
 attachment="true"  content-type="html/text" 
 subject="Employee Report for Empno ${EMPNO}">  Dear ${ENAME}, 
    Please review the attached document.</xapi:message>
  </xapi:email>
  <xapi:print id="printer1"  printer="${PRINT_URL}" copies="2"
   orientation-requested="3" />
 </xapi:delivery>
 <xapi:document key="${EMPNO}"  output="c:\burst\sample\${EMPNO}_${ENAME}.pdf" 
  output-type="pdf" delivery="123">
    <xapi:template type="rtf" location="${EMP_TEMPLATE}">
    </xapi:template>
  </xapi:document>
 </xapi:request>
</xapi:requestset>
A sample control file available here.

This will not exactly satisfy the above requirement but it gives an idea, how we can proceed to achieve the above requirement.

Here is the sample usage of Bursting Engine. We can call bursting engine either directly or through DocumentPrecoessor. Calling directly gives more control over some of the internal methods. API accept the Control file, Data File and Temporary directory path.

Using BurstingProcessorEngine directly..

try {
BurstingProcessorEngine dp = new BurstingProcessorEngine();
dp.deleteTempOutputFile(false);
dp.setTempDirectory("c:\\burst\\sample");//Set the temp file
dp.setXMLAPI("C:\\burst\\sample\\SampleControlFile.xml"); //Set Bursting Control file.
dp.setData("c:\\burst\\sample\\employee.xml"); //Data File
dp.registerListener(this); //Set the listener
Properties prop = new Properties(); //add properties and variables//
prop.put("user-variable:EMAIL_SERVER", "myemailserver.com");
prop.put("user-variable:EMAIL_PORT", "25");
prop.put("user-variable:FROM_EMAIL_ADDRESS", “admin@xyz.com");
prop.put("user-variable:CC_EMAIL_ADDRESS", "cc@xyz.com");
prop.put("user-variable:PRINTER_URL", "ipp://myprintserver:631/printers/printer1");
prop.put("user-variable:EMP_TEMPLATE", "c:\\burst\\sample\\employee.rtf");
dp.setConfig(prop);
dp.process();
dp.deletTemporaryOutputFiles();
} catch (Exception e) {
Logger.log(e);
}

Using DocumentProcessor:

try {
DocumentProcessor dp = new DocumentProcessor("C:\\burst\\sample\\SampleControlFile.xml","c:\\burst\\sample\\employee.xml", "c:\\burst\\sample");
dp.setTempDirectory("c:\\burst\\sample");//Set the temp file
dp.setXMLAPI("C:\\burst\\sample\\SampleControlFile.xml"); //Set Bursting Control file.
dp.setData("c:\\burst\\sample\\employee.xml"); //Data File
dp.registerListener(this); //Set the listener
Properties prop = new Properties(); //add properties and variables//
prop.put("user-variable:EMAIL_SERVER", "myemailserver.com");
prop.put("user-variable:EMAIL_PORT", "25");
prop.put("user-variable:FROM_EMAIL_ADDRESS", “admin@xyz.com");
prop.put("user-variable:CC_EMAIL_ADDRESS", "cc@xyz.com");
prop.put("user-variable:PRINTER_URL", "ipp://myprintserver:631/printers/printer1");
prop.put("user-variable:EMP_TEMPLATE", "c:\\burst\\sample\\employee.rtf");
dp.setConfig(prop);
dp.process();
} catch (Exception e) {
Logger.log(e);
}


A sample test case including sample java application, control file, data file, rtf template is available here. Please make sure you have following libraries in class path
Collection.jar, xdo.jar, Xmlparserv2.jar, mail.jar, Activaton.jar, aolj.jar, i18n, xdoparser.jar,Versioninfo.jar and use 10.1.3.4+ release.

Try it out and let me know your experience. We will see some more interesting example during coming post, so stay tune…

TrackBack

TrackBack URL for this entry:
http://blogs.oracle.com/mt/mt-tb.cgi/10564

Comments (5)

Arvind:

Hi Ashish,
Thanks for the information provided on bursting.
I have tried the control file mechanism and I am able to send files through email delivery mechanis.
What I want to find out is how we can dynamically customize the delivery mechanism using a control file., i.e. If one employee needs his payslip delivered through mail another through fax etc. So how do we do the changes in the control file to make it dynamic. (assuming the delivery mechanism is stored in some table on a Database).

On the same lines, I have one more question.
If I am streaming the XML onto the enterprise server, which has a report with an empty Data Model. So, I will be passing the data model from the web services. Is it posible to set the SQL uery prior to all this? I mean while creation of the report with an empty data model can we still set its Query for bursting?

Thanks in Advance,
Kind Regards,
Arvind.

Pradeesh:

Is Conditional Formatting possible in Pivot table template?

Hi Ashish,

I m developing financial reports from Essbase cube using MDX in BI Publisher. BIP Version is 10.1.3.4.

I m using Microsoft word 2003 with BI Publisher Desktop add in in it. The template I use is pivot table (i.e. Oracle BI Publisher-> Insert-> Pivot Table).

Is conditional fomatting possible in pivot table template report. As when I insert-> Conditional formatting it pivot table template it throws error as like ''Conditional format is not inside a table and therfore not applied to a table row''.


With Regards
Pradeesh

Pradeep:

This is in response to Pradeesh's question.

Pradeesh, you can do conditional formatting in Pivot table too. Just that the Pivot table wizard does not have this feature in-built and when you use the conditional formatting from insert-->conditional formatting, it expects the selection to be inside word table boundary. So if you select any content outside the table, then you get the message - ''Conditional format is not inside a table and therfore not applied to a table row". So if the content is outside of table you can either use the regional formatting for any conditional display, or you can manually enter the BI Publisher code syntax or even XSL syntax for conditional formatting. Just make sure to keep your XSL code inside the data placeholder. If you are still stuck, just let us know what you are trying to format conditionally and we can help.

Suresh:

Hi Ashish,
You had told that "Besides the individual output, there should be another single consolidated output against the same set of data. i.e. a summary report." Could you pls. let me know how to achieve this?

Thanks,
Suresh.

Anonymous:

Hi Ashish,
I have gone through this blog.
I am facing the following issues with standalone BIP.
Whatever indicated under "${...}" in the control file needs to be defined in java properties otherwise it is throwing an error.
So,how i will decide my file name on the basis of invoice number at runtime during bursting?
In the xml file, INVOICE_NUMBER is an element and my file bursting should be with the name of invoice_number.pdf.
In your example,${...} symbol is not getting replaced by the xml tag values unless it is defined under java properties.
Is there any way to trap the XML tag value in the datafile from the control file?

Thanks in Advance,
Kind Regards,
Snehotosh.

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

About This Entry

This page contains a single entry from the blog posted on March 11, 2009 8:24 AM.

The previous post in this blog was My journey with BI Publisher....

The next post in this blog is Bursting: Conditional delivery.

Many more can be found on the main index page or by looking through the archives.

Powered by
Movable Type and Oracle