Thursday, May 19, 2011

11.1.1.5 New Feature – More Data to Audit and Monitor

image

We believe Auditing and Monitoring capability for Reporting is crucial for the IT management and governance regardless if it’s enterprise level or department level deployment. So we are always committed to improve our BI Publisher Auditing and Monitoring capability since we introduced it for the first time

With the first release of 11g (11.1.1.3) we added this Auditing and Monitoring capability, which enables you to monitor who access to which report at what time.

With this new release of 11.1.1.5, we added more data to audit and monitor especially more BI Publisher reports specific information such as:

  • Report output format type
  • Layout Template name
  • Reporting locale
  • If the reports is run online (on-demand) or through the scheduler
  • Processing time
  • Reporting data size
  • Report error message
  • Scheduled job information

And these information can be all available through the database tables so you can use BI Publisher to generate your Auditing reports or visualize the data to gain more insights about how your users are doing on your reporting platform.

If you are interested in the power of the new BI Publisher Auditing and Monitoring, here is a video.

 

And, if you want to know how to enable the Auditing with the new data sets I’ll cover that below.

Enable Auditing Data

There are three things you need to do to enable the Auditing data.

Setup basic Auditing configuration

I have already talked about these steps before, take a look at these two posts for the detail.

  • How to Audit and Monitor BI Publisher Reports Access?
  • How to Visualize your Audit Data with BI Publisher?

    Run ‘xmlpserver_audit.sql’

    There is a SQL script that you can run to create an additional table, which will store more BI Publisher reports specific data to audit and monitor.

    Let’s take a look how to run the script step by step.

    1. Change the current directory to ‘%BI_HOME%user_projects/domains/bifoundation_domain/config/bipublisher/repository/Admin/Audit’.

    This directory should contain a file called ‘xmlpserver_audit.sql’ file.

    2. Run this script as SYS or SYSTEM user and alter the session user to the schema who owns the AUDIT tables.

    Example:

    Let’s say you have created the Audit schema with the RCU with ‘KAN_IAU’, then you can follow something like below.

    $ sqlplus / as sysdba

    SQL*Plus: Release 11.2.0.1.0 Production on Mon May 2 13:53:49 2011

    Copyright (c) 1982, 2009, Oracle.  All rights reserved.

    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options

    SQL> alter session set CURRENT_SCHEMA = KAN_IAU;

    Session altered.

     

    Now you can run the ‘xmlpserver_audti.sql’ script. Note that, when you run you'll be prompted to enter the following three schema names.

    • Basic Auditing Schema name
    • Edit Auditing Schema name
    • View Auditing Schema name

    With the above example of using ‘KAN_IAU’ as your basic schema, it would be something like below.

    • KAN_IAU
    • KAN_IAU_APPEND
    • KAN_IAU_VIEWER

    Here is the example:

    SQL> @xmlpserver_audit

    Table created.

    Index created.

    Enter value for 1: KAN_IAU

    old 1: GRANT ALL on xmlpserver to &&1

    new 1: GRANT ALL on xmlpserver to KAN_IAU

    Grant succeeded.

    Enter value for 2: KAN_IAU_APPEND

    old 1: GRANT INSERT on xmlpserver to &&2

    new 1: GRANT INSERT on xmlpserver to KAN_IAU_APPEND

    Grant succeeded.

    Enter value for 3: KAN_IAU_VIEWER

    old 1: GRANT SELECT on xmlpserver to &&3

    new 1: GRANT SELECT on xmlpserver to KAN_IAU_VIEWER

    Grant succeeded.

    old 1: CREATE OR REPLACE SYNONYM &&3..xmlpserver FOR &&1..xmlpserver

    new 1: CREATE OR REPLACE SYNONYM KAN_IAU_VIEWER.xmlpserver FOR KAN_IAU.xmlpserver

    Synonym created.

    old 1: CREATE OR REPLACE SYNONYM &&2..xmlpserver FOR &&1..xmlpserver

    new 1: CREATE OR REPLACE SYNONYM KAN_IAU_APPEND.xmlpserver FOR KAN_IAU.xmlpserver

    Synonym created.

    After that you need to restart the WebLogic Server to take that in effect. Once that’s done, BI Publisher will start feeding all the auditing and monitoring related information into the auditing tables, and you should be able to start access to the data to create reports and visualize it with BI Publisher.

    Create Reports to Visualize

    If you have already finished the steps mentioned on the previous blog posts then you should already have a JNDI/JDBC connection created. If you haven’t yet, then take a look at the following post. 

  • How to Visualize your Audit Data with BI Publisher?

    Make sure you assign appropriate application roles to this data source connection so that you or any users who need to create reports for the BI Publisher Auditing and Monitoring data will have an access to the data source.

    image

     

    With this new set of data available, you can now start creating reports to gain more insights about how your users use the reporting platform and prepare for a better reporting experience by responding and adjusting promptly.

    Start with Sample Reports

    We’re planning to release a set of sample Auditing and Monitoring reports as part of our sample reports inside the catalog some time soon but till then you can start creating your own reports against the Auditing tables by using BI Publisher. For those looking for something quick, I’m attaching a sample report here

    • Sample Auditing Report
    • Sample Auditing Data Model

    You can download the above files and upload them to your BI Publisher 11g (11.1.1.5) environment from the BI Publisher Catalog UI, but make sure the following three points before you run.

    1. Change the Data Model reference inside the Auditing report to point to the Auditing Data Model that you uploaded

    audit_datamodel_reference

    2. Change the Data Source inside the Auditing Data Model to your JNDI connection

    audit_default_datasource

    3. Update the SQL query to point to appropriate schema name.

    audit_sql_query

    Path to Improve Reporting Experience

    Again, the Auditing is not just about collecting the auditing data and record it. It’s about how you as IT manager or administrator understand your users and reports on the reports environment in order to improve the reporting experience. The more you understand them the better service you can provide. We believe that the new release of BI Publisher 11.1.1.5 would provide you a wide range of data to help you understand your reporting environment better and quickly. Hope you’ll enjoy the power of new BI Publisher Auditing and Monitoring capability.

    Also, as always, we’re very interested in your feedback. Please let us know what do you think about the data currently available, the sample reports, any additional requirements or improvement suggestion.

  • Thursday, May 12, 2011

    BI Publisher 11g - 11.1.1.5 is here!

    New Oracle BI Publisher 11g Release 11.1.1.5 is released! Here is a list of the new features.

    clip_image002

    Much Faster Interactive Reporting Experience

    Using BI Publisher to interact with your data is snappy. Generating interactive report output uses less memory and is faster than ever. BI Publisher’s highly optimized, three layer caching mechanism provides a highly responsive, interactive reporting experience.

    New Interactive Component - List

    The List component is a nifty way to filter data in an interactive report. When you click values in the list, BI Publisher automatically filters the data in the report. In the Layout Editor you can set the orientation of the List to be horizontal or vertical and over 30 other options to make it visually appealing for your consumer needs. Lists are another great way to interact with your report to gain more insight.

    clip_image004

    clip_image007

    Both Native and Web Apps for iPhone & iPad

    More and more business tasks are performed on mobile devices like iPhone and iPad, so why not browse reports and interact with your data on your mobile device with BI Publisher? Simply access your BI Publisher reports with Safari or other browsers on your iPad or iPhone, or install the Oracle BI Mobile App for iPhone and iPad to enjoy the same rich, fast interactive reporting experience as on your desktop or laptop.

    Enterprise Reporting Platform for Oracle - E-Business Suite

    BI Publisher now supports Oracle E-Business Suite’s data level security based on user responsibility and allows you to switch responsibilities on the fly. You can use BI Publisher 11.1.1.5 to view, manage, and deliver reports against E-Business Suite data and join and aggregate with data from other data sources. Utilities are available to help you convert from Oracle Reports and upgrade to BI Publisher 11g. Start taking advantage of many of the great BI Publisher 11g new features with your E-Business Suite data today.

    clip_image008

    clip_image010

    New Data Source – Local Excel File

    Often times you need data in Excel to supplement other data or you need to visualize it quickly. BI Publisher 11.1.1.3 added Excel files as a data source so you could create a report against Excel data located on the server. BI Publisher 11.1.1.5 goes one step further. Now you can upload Excel spreadsheets from your local machine directly to a Data Model. Create reports from the uploaded Excel spreadsheet or join it and aggregate it with other data sources. Reporting with local Excel files is a great way to empower your users to visualize and share data easily and still maintain a centralized report environment.

    New Template Type - Excel Template

    Some users just love Excel, so we added Excel as a report layout design option. In addition to the existing template options like BI Publisher Templates, RTF, PDF, Flash, and others, you can now use Excel to design your report the way you want, using custom functions and Excel Macros to split data across multiple sheets, calculate values dynamically, then share with your colleagues.

    clip_image012

    clip_image014

    Auditing and Monitoring

    Auditing is not just about compliance, it’s a way to improve customer service by understanding what your users like to do, when and how they access and view reports. BI Publisher 11.1.1.3 included a framework to help IT Administrators collect data required for auditing. BI Publisher 11.1.1.5 enhances the audit and performance information captured and introduces a method to store the data into a database. Now you can use BI Publisher to visualize, analyze and report on your auditing and performance information.

    New Output Format Type – Native Excel 2007 Output

    Now you can download your report as Excel 2007 format and open it with the latest Excel on both Windows and Mac with high fidelity formatting and layout. You can use repeating groups in your report to automatically group data in separate worksheets. With this format option the downloaded Excel file is 70% smaller compared to other Excel output types, which makes it easier to share your report in Excel with your colleagues.

    clip_image015

    clip_image017

    Reports Development Life Cycle Management

    Developing reports often involves multiple phases and processes before going live. Reports need to be moved to a testing environment after the development and then to the production environment. You can use the new BI Publisher Catalog Utility to move your reports either one at a time or in batch from one environment to another all without shutting down servers so users can continue to generate the mission critical documents and reports they need.

    Want to learn more about BI Publisher?

    clip_image019

    Follow us @bipublisher for our latest news, inside scoop, or tweet us your feedback!

    clip_image021

    Connect with other BI Publisher professionals!

    clip_image023

    Find How-to and solutions over 500 articles!

    clip_image025

    Subscribe our channel and check our introduction and How-to videos!

    clip_image027

    Ask any question you have and get answered at our Discussion Forum!

    Saturday, March 12, 2011

    Share and Deliver BI Publisher Reports in Multiple Languages

    global flags

    When you share your reports with someone who speak and read in different languages you want your reports to be shown in their language, right ? Well, translating reports with BI Publisher is not only easy but also reduces the maintenance cost a lot.

    Many of us in the BI Publisher product development team used to work in Globalization and Multi Lingual support, which enables Oracle products and applications to be used in many different languages and countries and territories.  And we have a lot of experience in this area. In fact, being a strategic reporting platform for Oracle EBS, PeopleSoft, JD Edwards, Siebel, and many other Oracle application products, our customers from all over the world are generating thousands of thousands of reports, including out-of-the-box pre-developed reports from Oracle and customer created or customized reports, in their own local language everyday as they operate and manage their business.

    Today, I’m going to talk about this very topic, how to translate my reports with BI Publisher 11G.

    Translation Grows, not the Numbers of the Reports

    Most of the reporting tools, regardless if it’s traditional or new, always take this translation on the back burner. They require their users to copy an original report and translate the whole thing. So when you want to support additional10 languages you will need to have 10 copies of the original. Imagine when you have 50 reports then you will end up having 500 reports (50 x 10) ! Now you need to maintain these 500 reports, whenever you need to make a change in a report you need to apply the same change to the other 10 reports. And as you imagine this is not only a nightmare for IT managements but not acceptable especially for the applications like Oracle EBS that supports over 30 languages.

    So first thing we did was, very simple, we separated the translation out of the report and marry it to the report only at the report generation. This means, regardless of how many languages you need to support you need to have only one report and translation files for the 10 languages, which would contain the translated letters and words. So let’s say you have 50 reports and need to support 10 languages for those reports you still have only 50 reports and each report now has 10 language translation files. Yes, translation is the one should grow as you add more languages to support, not the report itself!

    And second, we provide the translation files in XLIFF format, which is an international standard XML based format to exchange and maintain translation strings. So once you generate the XLIFF files for your reports with BI Publisher then you can work with any translation vendors in the world to make a mass translation or you can translate the XML files by yourself by manually updating the translatable strings presented in this text file.

    Lastly, we made it easier to manage the translation process starting from generating the XLIFF files to uploading the translated XLIFF files back to the BI Publisher server. You can generate, download, upload the XLIFF files from the BI Publisher’s Web interface with your browser and you can see the translated reports right away without needing to shutdown or restart your server. While the translated reports are displayed based on your language preference setting you can also specify a different language when you schedule or deliver the reports so that they can be generated in your customer’s preferred language.

    What Can I Translate?

    When it comes to translation there are three things.

    First, report content translation. When you receive a report you like to see the content like report title, section title, comments, annotation, table column header, and anything that are static and embedded in the report. in your preferred language. We call this Reports Content translation.

    Second, when you open a report online you might want to see not only the report content being translated but also the report UI, such as report name, parameter name, layout name, and anything that would help you to navigate around the reports, to be translated in your language. We call this Reports UI translation. And this separation of the Reports Content and Reports UI translation makes it very useful especially when you want to navigate through the reports in your preferred language UI but want to generate the reports in your customer’s preferred language. Imagine you are English native speaker and need to generate and send a report to your customers in China. You like to see the report name, parameter name in English so that you can comfortably navigate to the report and generate the report output, but like to see the report generated in Chinese so that the your customers in China can understand the report when they receive it.

    And lastly, you might want to see even the data presented in the report to be translated. For example, you might want to see product names in an Order Status report to be translated based on the report viewer’s language preference. We call this Reporting Data translation. Since this Reporting Data translation is maintained at the data source level such as Database tables along with the main data, you need to prepare the translation at the data source level first. Then, you want to make sure that your query is switched accordingly based on the language preference setting so that the translated data will be retrieved.

    How to Translate BI Publisher Reports?

    Now when it comes to ‘how to translate BI Publisher reports?’ the main focus here is about the translation for the Report Content and Report UI. And I just created this video to show you how to create and manage the translation with BI Publisher 11G. Please take a look at the clip below.

     

    In today’s business world, customers and suppliers are from all over the world regardless of the size of the company or organization. Supporting multiple languages for your reports is no longer something ‘nice to have’, it’s mandatory. BI Publisher is designed to support multi lingual reports from the beginning without any extra hidden cost of license or configuration like other reporting tools such as Crystal Reports. You can support additional languages translation at any time with the very simple steps shown in the video above. Happy translation!

    Please share your translation experience with us! 

    Thursday, September 2, 2010

    Oracle BI Publisher 11G Installation

    Have you already installed BI Publisher 11G and started playing around ? Well, as much as I was excited about the release news when I came back from my big vacation, I had a bit of bumps on the road of installing until logging into the initial home page. First, I couldn’t proceed on the installer wizard steps more than step 4, then after having fixed the problem I still couldn’t start some BI services and then couldn’t open BI Publisher login window.

    Well, finally figured out the root cause of the issue and its solution. Basically, that my PC environment was Windows XP on a VM (Parallel/Mac) and it’s running on DHCP. And the installer and some components (it’s BI Cluster Controller Server) don’t like it. So I needed to install a Loopback Adaptor and setup a static IP address, and then register that with machine name in Window’s etc/host file properly.

    After that is done and cleared up the failed installation completely, the installation worked like a charm. It took about one hour or so and was so smooth that I don’t even remember what I was frustrated about! Anyway, hope your installation went smooth without hassle like the ones I had. But if it didn’t you might want to proceed reading and hope this helps you to get going.

    Installation

    In order to install BI Publisher 11G you need to get the BIEE 11G installation  package either from OTN or eDelivery. Then you create a repository in your database by using RCU (Repository Configuration Utility) before you start installing the BIEE 11G.  I’m not going to talk about the detail steps of the installation here, you can find many posts on other blogs out there or the installation guide about such detail steps with screenshots. The installation steps itself is pretty simple. However, if your network is not configured well then you will get in trouble big time. So make sure your network configuration before you start installing BI 11g.

    Network Configuration

    This is mandatory and really critical thing to do especially when you are trying to install onto your laptop or PC desktop with DHCP setting.

    Basically there are three things to do before the installation in terms of the network setting.

    1. Make sure if you have installed MSFT loopback adapter.
    2. Set a static IP address to the loopback adapter network.
    3. Set the C:\WINDOWS\system32\drivers\etc\host file with a computer name and the static address you set to the loopback adapter.

    All the detail can be found in this Oracle Database 11GR2 Installation guide. Click the link, it gets you directly to the network configuration section.

    But one tricky thing is a domain name for your machine name such as ‘us.oracle.com’. If you are not sure about the domain name then don’t include it in the etc/host file. My example is below.

    # For example:
    #
    #      102.54.94.97     rhino.acme.com          # source server
    #       38.25.63.10     x.acme.com              # x client host

    127.0.0.1       localhost

    127.0.0.1       .psf

    10.10.10.10   knishida-vm1 

    Make sure you reboot your machine once you have set the network configuration, then start the BI11g installation. Without this proper setting you will hit the following issues:

    1. You can't proceed the installation steps after where you type username/password for weblogic user.
    2. Your ClusteringControler or PSServer doesn't start
    3. You can't login to Answers or any other BI apps
    4. You can't even open BI Publisher login window
    5. You can't open RPD online

    I’ve already installed, Any workaround to fix it manually ?

    If you have already installed BI11g and having the above issues you can workaround by setting up the etc/host file properly. If there is still a problem starting up the BI Clustering Controller Server then remove a domain name, which is 'us.oracle.com' in my case, from NQClusterConfig.INI located under C:\biee11\instances\instance1\config\OracleBIApplication\coreapplication (I installed the BI11g under C:\biee11.) if any. After removing all the domain name restart only the cluster control server manually from the Fusion Control (EM) then you should be able to start the cluster control server, and then you will be able to open BI Publisher page and login, or login to BI first then access to BI Publisher page. However, this workaround might be wiped out the next time you stop and start all the BI services. As you have realized by this time, regardless of whether you select ‘Simple Install’ or ‘Enterprise Install’ at the installation the BI Clustering Control Server gets installed. And you need that to access to the BI Server even if there is only one, and hence you need that to login to BI Publisher.

    Need to Reinstall or Cleanup ?

    So, while you can workaround the network issue as mentioned above I still strongly recommend that you review the network configuration and do a fresh install again. The issue like above can be work around temporally, but the workaround will be needed to perform every time you start the BI servers, which is not going to make you a happy camper.

    When you do try another fresh installation then make sure you completely delete the original one by following the sequence mentioned in the installation guide. If you have something still left over from the previous installation you will get an error message during the installation. Here is a brief highlight of the steps in the order.

    1. Run the deinstall script and select the Deinstall instances managed by a WebLogic domain option.

    2. Stop all Oracle Business Intelligence processes and servers, including all OPMN-controlled components and JEE components.

    3. Drop the Metadata Services (MDS) and Business Intelligence Platform (BIPLATFORM) schemas using RCU.

    4. Run the deinstall script and select the Deinstall the Oracle home option.

    5. Deinstall the Oracle Common home manually or by running the deinstall script that it contains.

    6. Use the Oracle WebLogic Server uninstaller to uninstall WebLogic Server.

    7. Remove the Oracle home (if necessary).

    8. Remove the Middleware home and any other homes (Domain home, Applications home, and Instance home) that might have been installed outside of the Middleware home.

    After following the steps documented in the installation guide to delete everything, make sure you don’t have any entry in the registry if you are installing onto Windows system. Especially the following stuff.

    1. Remove all the registry entries that contains the Oracle - OHxxxxx. (e.g. HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\coreapplicatin_OH868503665)
    2. If you have followed the steps mentioned above you shouldn’t see this. But if you still see this Oracle Common Home menu (‘Oracle – OHxxxxx’) from the Start –> Program File menu then remove it by going to ‘C:\Documents and Settings\All Users\Start Menu\Programs’ in the registry then delete such.
    3. Even If you have followed the steps above you might still see the OPMN and Node manager windows services, you can do this by deleting these entries from registry, HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services

    Share Your Experience!

    Well, hope you have installed BI Publisher 11G successfully and start playing around and getting excited about the new features and products as I do now. But if you have found any issue and workaround during the installation and configuration please share!

    Wednesday, September 1, 2010

    Here Comes BI Publisher 11G!

    It’s been long since the last post. I’ve been on vacation plus leave of absence and traveling around northern Europe with my bike ‘Surley’. It was the best trip in my life and maybe the best thing I’ve ever done. But now back to work, another thing I love!

    Well, first thing I found when I came back is the news of BI EE 11G being released finally! This is the long waited and much needed release with a lot of innovative new features and products. It provides much winder solutions and functionalities and it is the most competitive product in today’s BI and Reporting market. It’s Complete, Integrated, and Open.

    And sure enough it goes the same for BI Publisher too. This is the most anticipated and the most innovative release with a lot of new offereings. Let me go through briefly.

    Data Model Editor

    image

    This is a new product targeted for the reports developers. Well, probably I don’t need to explain how this product improve your development productivity. Now you don’t need to see or edit the Data Template XML files anymore! You can build queries, create calculations and define the data structure all in the Data Model Editor Web UI. Along with this, now the data model you create is completely separate from reports. That means you can choose any existing data model when you create a report. This makes the report maintenance much easier and improve the data quality and governance.

    Layout Editor

    image image

    This is another new product targeted for both Business Users and Reports Developers. This is a tool that you can use to create from a simple report to a management report to a pixel perfect report within the Web UI. You don’t need to install anything, not even need an add-ins or anything. The Web UI is similar to the MS Office 2007 , it’s very intuitive so the business users don’t need to have any special training. You can open the Layout Editor with your browser, select data columns you want to display, format and layout as if you use MS-Word, then boom, you get your report output the way you want and many different formats.

    Interactive Viewer

     image

    This is personally the most excited new product in this release for me. Finally BI Publisher brought your reporting experience complete and rich. You can not only generate the reports in a pixel perfect, but the same report allows you to interact with the data to get deeper insight. You can click any chart or pivot table within the report and all the data presented in the report automatically and instantaneously updated and filtered based on the Click! I’ve been working on many BI and Reporting projects where often the reports requirements contains both pixel perfect and interactivity nature. Until recent the users either needed to sacrifice some functionalities or requirements for a sake of selecting one reporting tool or needed to have two reports with two different reporting tools or components. This brought a tremendous frustration and maintenance headache on both the report users and developers. But not anymore. This is the complete reporting solution for both interactive reporting and product reporting, and for both the users and the developers.

    Well, there are many other new enhancements like Enterprise Security and Scalability, Scheduler, UI, Reports editor, new diagnostic capability, etc. I will talk about them some time soon. So stay tuned!

    Friday, May 7, 2010

    Date Formatting and Handling for Siebel Reporting

    I have discussed about the Siebel Date related issue before at one of the posts. The issue is that the IO returns the date data in a different format from the one BI Publisher expects (Canonical format), which prevents BI Publisher from formatting the date or handling the date data with its functions.

    There are some workarounds available I discussed about at the post. But not anymore! Siebel Reporting product development team at Oracle has addressed the issue so you don’t need the workaround anymore!

    IO Returns Date in Canonical Format with 8.1.1.2 !

    UPDATE: Actually, this functionality didn’t make it to the production. It’s planned, but I don’t know when or which release will have the fix. I will update once I get the update. Meanwhile you can use the following ‘getCanonicalDate’ function.

    First, with the latest FixPack 8.1.1.2, which was released recently, the IO now returns the date in the canonical date format. So you can use BI Publisher’s date related function or formatting with the data without any workaround.

    New Function - getCanonicalDate

    Second, if you can’t apply the FixPack 8.1.1.2 then you can download an updated XSLFunction.jar file from Oracle Support page (ID 764191.1) and replace the original with this new one. This new library includes a function called, ‘getCanonicalDate’, and this is the one you can use to convert the Siebel date string to the canonical date format.

    Here is an example of how you can use the ‘getCanonicalDate’ function.

    <?namespace:psfn=http://www.oracle.com/XSL/Transform/java/com.siebel.xmlpublisher.reports.XSLFunctions?>

    xdoxslt:date_diff('d', psfn:getCanonicalDate(CreatedDate), psfn:getCanonicalDate(LastUpdatedDate), $_XDOLOCALE, $_XDOTIMEZONE)

    As you see in the example, make sure you declare the ‘psfn’ namespace first before you use the ‘getCanonicalDate’ function. You can take a look at ‘Siebel’s Extended Function for RTF Template’ if you don’t know how to enable your Word Add-ins Template Builder to test with the library.

    And of course, you need to replace the existing one with this new library at the server side to take this in effect when you run the report. You need to do this at the two places, one is at BI Publisher server, and another is at Siebel home.

    BI Publisher Server

    Take a look at the bookshelf, ‘Copying Siebel JAR files to BI Publisher’, which describes the detail.

    Siebel Home

    Replace %SIEBEL_HOME%/classes/XSLFunctions.jar with the downloaded one.

    Tuesday, April 20, 2010

    How to Schedule a Report with BI Publisher Web Service?

    This is part of the BI Publisher Web Service series. I have already covered ‘How to use BI Publisher Web Service with JDeveloper 11G’ and ‘How to Run a Report with BI Publisher Web Service’. If you haven’t checked the posts and are interested in please click the above links to check.

    Today, I’m going to talk about how to schedule a BI Publisher report with the Web Service within a Java application.

    Which Method to Schedule Report?

    So which method we can use to schedule ? It’s like the ones for running a report, there are two methods. One is ‘scheduleReport() and another is ‘scheduleReportInSession()’. ‘scheduleReport() takes a username and password while scheduleReportInSession takes a session token along with a ‘ScheduleRequest’ object. And both returns a job id, which you can use to monitor and manage the scheduled job later.

    Definition:

    • String scheduleReport(ScheduleRequest srequest, String username, String password)
    • String scheduleReport(ScheduleRequest srequest, String SessionToken)

    With those methods you can do pretty much the same things you can do from the UI. I’m going to use scheduleReport() method for my example below.

     

    How to Call scheduleReportInSession()

    Before you run the scheduleReportInSession() method, first you need to create a ReportRequest object by giving a report path for the report you want to run. This is exactly the same step I mentioned in the last post with runReportInSession().

    Second, you need to create a DeliveryRequest object if you need to deliver the report. You can set a delivery option and its delivery type specific information here.

    Third, now you need to create a ScheduleRequest object by setting the ReportRequest and DeliveryRequest objects.

    And finally you can call the scheduleReportInSession() method to schedule a report.

    Here is a list of those four steps:

    1. Create DeliveryRequest object
    2. Create ReportRequest object
    3. Create ScheduleRequest object
    4. Call scheduleReportInSession() method

    So, let’s take a look at the each step.

     

    Create DeliveryRequest Object

    1) Create Delivery Option to Set Delivery Information

    First you need to create a DeliveryOption object. There are different types of the objects, each of which is for each delivery type. So if you want to deliver your report by email then there is a one DeliveryOption for Email called ‘EmailDeliveryOption’. And it goes the same for other delivery options. Here is a list of the delivery options available for you with BI Publisher.

    • Email
    • Fax
    • FTP
    • Local File System
    • Printer
    • WebDAV

    And all the options are available with the Web Service. When you create the DeliveryOption you can set each of the delivery option specific information. For example, if you want to use the email delivery option then you can set the email delivery related information such as an email subject,  an email address shown as ‘from’ or ‘cc’, etc.

    Here is a list of the DeliveryOption types and a list of methods that you can use to set the delivery related information.

    EmailDeliveryOption

    Method

    Description

    void setEmailTo(String)

    You can set a To Email address.

    void setEmailSubject(String)

    You can set a Email subject.

    void setEmailFrom(String)

    You can set a Email From address.

    void setEmailCC(String)

    You can set a CC Email Address.

    void setEmailBody(String)

    You can set a Email body message.

    FaxDeliveryOption

    Method

    Description

    void setFaxNumber(String)

    You can set a fax number.

    void setFaxServer(String)

    You can set a fax server name which is the one that has already been registered at your BI Publisher Server.

    Printer

    Method

    Description

    void setPrinterName(String)

    You can set a Printer name that has already been registered at your BI Publisher server environment.

    void setPrintNumberOfCopy (String)

    You can set a number of copy that you want to print the report in.

    void setPrintRange(String)

    You can set a range of pages of the report that you want to print.

    void setPrintSide(String)

    You can set both sides printing.

    void setPrintTray(String)

    You can specify which printer tray you want to use for your printing.

    FTP

    Method

    Description

    void setFtpServerName (String)

    You can set a FTP server name that has already been registered at your BI Publisher server.

    void setFtpUserName(String)

    You can set a username for the FTP server.

    void setFtpUserPassword (String)

    You can set a password for the FTP server.

    void setRemoteFile(String)

    You can set a file name for the report output.

    void setSftpOption(String)

    You can set SFTP option.

    Local File System

    Method

    Description

    void setDestination(String)

    You can set a full path for the report output including the report output file name so that the report can be saved on the specified location on the server’s file system.

    WebDAV

    Method

    Description

    void setServer (String)

    You can set a WebDAV server name that is registered at your BI Publisher server.

    void setRemoteFilePath (String)

    You can set a file name for the report output and the path.

    void setUserName (String)

    You can set a username for the WebDAV server.

    void setPassword (String)

    You can set a password for the WebDAV server.

    void setDeliveryAuthType (String)

    You can set an authentication type of the WebDAV server.

    void setDeliveryAuthTypeBasic (String)

    You can set Basic authentication type.

    void setDeliveryAuthTypeDigest (String)

    You can set Digest authentication type.

    Note that you need to setup the delivery servers appropriately from your BI Publisher Server UI before you use the delivery options with the Web Service. For example, if you want to use the Email delivery option then you need to setup a default Email server from the UI. Only the delivery options configured appropriately at the server can be used from the Web Service.

    image

    Example:

    //Create a Delivery Option for Email delivery
    EMailDeliveryOption em = new EMailDeliveryOption();

    //Set Email delivery related information
    em.setEmailTo("kanichiro.nishida@oracle.com");
    em.setEmailSubject("This is a BIP Web Service Test...");
    em.setEmailFrom("bip_admin@oracle.com");
    em.setEmailCC("kanaugust@gmail.com");
    em.setEmailBody("Test");

     

    2) Create Delivery Request

    Once you have created the DeliveryOption then you can create a DeliveryRequest object by passing the DeliveryOption object.

    Here is a list of the methods that you can use to set the DeliveryOption to create a DeliveryRequest.

    • void setEmailOption (EMailDeliveryOption)
    • void setFaxOption (FaxDeliveryOption)
    • void setPrintOption (PrintDeliveryOption)
    • void setFTPOption (FTPDeliveryOption)
    • void setLocalOption (LocalDeliveryOption)
    • void setWebDAVOption (WebDAVDeliveryOption)

    Example:


    DeliveryRequest dr = new DeliveryRequest();
    dr.setEmailOption(em);

     

    Create ReportRequest Object

    This is exactly the same process as I talked at the last post. So take a look at the post if you don’t know how to create the ReportRequest object.

    Create ScheduleRequest Object

    When you create the ScheduleRequest object you can set a report to schedule and the delivery information by setting the above mentioned two objects, DeliveryRequest and ReportRequest.

    Also, you can set the following information to the ScheduleRequest object.

    • Email Address for Notification
    • Indication of Saving the Data
    • Indication of Saving the Report Output
    • Repeat Count
    • Repeat Interval
    • Start Date for the Scheduling
    • End Date for the Scheduling
    • Calendar for Scheduling
    • Time Zone for Scheduled Time
    • Job Name
    • Delivery Request
    • Report Request
    • Indication of Public Scheduling
    • Bursting Delivery

    If you don’t set the Start Date then it would be the same as ‘immediately run’ option.

    And here is a list of the methods that you can use to set such options.

    Function

    Method

    Description

    Report Request

    void setReportRequest (ReportRequest)

    You can set a ReportRequest object to select a report that you want to schedule and run.

    Delivery Request

    void setDeliveryRequest (DeliveryRequest)

    You can set a DeliveryRequest object to set a delivery option. See ‘Pre-Requisite for Delivery’ section for the detail of how to set the delivery settings.

    Start Date for the Scheduling

    void setStartDate(Calendar)

    You can set a start date for the scheduling to start. If it’s null or not specified then the scheduled job will run immediately.

    End Date for the Scheduling

    void setEndDate(Calendar)

    You can set an end date for the scheduling.

    Job Name

    void setUserJobName(String)

    You can set a name for this scheduling job.

    Calendar

    void setJobCalendar(Calendar)

    You can set which calendar to use for the scheduling time. E.g. Gregorian

    Time Zone

    void setJobTZ(String)

    You can set an appropriate time zone that you want to use for the specified time for the scheduling.

    Repeat Count

    void setRepeatCount(int)

    You can set a repeat count for the scheduled job.

    Repeat Interval

    void setRepeatInterval(int)

    You can set an interval time for the scheduled job to run.

    Email Address for Notification

    void setNotificationTo(String)

    You can set an email address to send a notification of the scheduled job.

    Request to send a notification message when failed

    void setNotificationWhenFailed (boolean)

    You can specify whether you want to send a notification message when the scheduled job fails or not.

    Request to send a notification message when Success

    void setNotificationWhenSuccess (boolean)

    You can specify whether you want to send a notification message when the scheduled job runs successfully or not.

    Request to send a notification message when Warning

    void setNotificationWhenWarning (boolean)

    You can specify whether you want to send a notification message when the scheduled job ends with warning or not.

    Indication of Saving the Data

    void setSaveDataOption(boolean)

    You can specify whether you want to save the data for the scheduled job or not. The data will be saved when it’s set True and it can be accessed only through BI Publisher Enterprise UI.

    Indication of Saving the Report Output

    void setSaveOutputOption(boolean)

    You can specify whether you want to save the report output for the scheduled job or not. The output will be saved when it’s set True and it can be accessed only through BI Publisher Enterprise UI.

    Indication of Public Scheduling

    void setSchedulePublicOption (boolean)

    You can specify whether you want to make the scheduled job to be publicly accessible or not.

    Bursting Delivery

    void setScheduleBurstringOption (boolean)

    You can specify whether you want to use the bursting option that is pre-configured for this report or not. In order to use this option you need to make sure that the report you’re scheduling has been configured for the bursting option through BI Publisher Enterprise UI.

    Example:


    ScheduleRequest sreq = new ScheduleRequest();

    //Set DeliveryRequest
    sreq.setDeliveryRequest(dr);

    //Set ReportRequest
    sreq.setReportRequest(req);

    //Set scheduling information
    sreq.setNotificationTo("kanichiro.nishida@oracle.com");
    sreq.setSaveDataOption(true);
    sreq.setSaveOutputOption(true);
    sreq.setScheduleBurstringOption(false);
    sreq.setSchedulePublicOption(true);
    sreq.setUserJobName("WebService Job1");

     

    Call scheduleReportInSession()

    Now you can set the ScheduleRequest and the session token to run the scheduleReprotInSession() method. It returns a job id when it runs successfully, which you can use to monitor and manage the job. For example, in future when you need to suspend or delete the job then you will need this job id to do such.

    Example:

    job_id = publicReportService.scheduleReportInSession(sreq, sid);

    And that’s it! Once you run the scheduleReportInSession() successfully then you should see a new job created from the BI Publisher’s scheduler UI page.

    There are more BI Publisher WebService APIs available, but these I’ve covered are the most common. If you have some other APIs that you want me to cover let me know, I can talk about that too.

    Here is my whole source code for this scheduling exercise.

    package project1;

    import com.oracle.xmlns.oxp.service.publicreportservice.AccessDeniedException;
    import com.oracle.xmlns.oxp.service.publicreportservice.AccessDeniedException_Exception;
    import com.oracle.xmlns.oxp.service.publicreportservice.DeliveryRequest;
    import com.oracle.xmlns.oxp.service.publicreportservice.EMailDeliveryOption;
    import com.oracle.xmlns.oxp.service.publicreportservice.InvalidParametersException;
    import com.oracle.xmlns.oxp.service.publicreportservice.InvalidParametersException_Exception;
    import com.oracle.xmlns.oxp.service.publicreportservice.LocalDeliveryOption;
    import com.oracle.xmlns.oxp.service.publicreportservice.OperationFailedException;
    import com.oracle.xmlns.oxp.service.publicreportservice.OperationFailedException_Exception;
    import com.oracle.xmlns.oxp.service.publicreportservice.PublicReportService;
    import com.oracle.xmlns.oxp.service.publicreportservice.PublicReportServiceClient;
    import com.oracle.xmlns.oxp.service.publicreportservice.PublicReportServiceService;
    import com.oracle.xmlns.oxp.service.publicreportservice.ReportRequest;
    import com.oracle.xmlns.oxp.service.publicreportservice.ReportResponse;
    import com.oracle.xmlns.oxp.service.publicreportservice.ScheduleRequest;

    import java.io.IOException;
    import java.io.OutputStream;
    import java.io.PrintWriter;
    import java.net.URL;
    import java.util.Calendar;
    import java.util.Date;
    import java.util.GregorianCalendar;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import javax.xml.datatype.DatatypeConfigurationException;
    import javax.xml.datatype.DatatypeFactory;
    import javax.xml.datatype.XMLGregorianCalendar;
    import javax.xml.namespace.QName;

    public class BipServletTest extends HttpServlet {
        private static final String CONTENT_TYPE =
            "text/html; charset=windows-1252";
        private static PublicReportServiceService publicReportServiceService;

        public void init(ServletConfig config) throws ServletException {
            super.init(config);
        }

        public void doGet(HttpServletRequest request,
                          HttpServletResponse response) throws ServletException,
                                                               IOException {
            response.setContentType(CONTENT_TYPE);
            OutputStream os = response.getOutputStream();
            //PrintWriter out = response.getWriter();
            String sid = "";
            publicReportServiceService = new PublicReportServiceService(new URL("http://knishida-lap.us.oracle.com:7001/xmlpserver/services/PublicReportService"),
                                                   new QName("http://xmlns.oracle.com/oxp/service/PublicReportService",
                                                             "PublicReportServiceService"));
            PublicReportService publicReportService =
                publicReportServiceService.getPublicReportService();

            //To get a session id
           try {
                sid = this.getSessionID("Administrator", "Administrator", publicReportService);
            } catch (AccessDeniedException_Exception e) {
                System.out.println("invalid user"); 
            }

           String job_id = this.scheduleReportInSession(publicReportService, sid);

            try {
                publicReportService.logout(sid);
            } catch (InvalidParametersException_Exception e) {
                System.out.println(e);
            } catch (AccessDeniedException_Exception e) {
                System.out.println(e);
            }
        }

    public String getSessionID(String username, String password, PublicReportService publicReportService) throws AccessDeniedException_Exception {
        String sid = publicReportService.login(username, password);
        return sid;
    }

    public String scheduleReportInSession(PublicReportService publicReportService,
                                        String sid){
        // Set Report request attributes
        ReportRequest req = new ReportRequest();
        req.setAttributeFormat("pdf");
        req.setAttributeLocale("en-US");
        req.setAttributeTemplate("Simple");
        req.setReportAbsolutePath("/HR Manager/Employee Salary Report/Employee Salary Report.xdo");

        EMailDeliveryOption em = new EMailDeliveryOption();
        em.setEmailTo("kanichiro.nishida@oracle.com");
        em.setEmailSubject("This is a BIP Web Service Test...");
        em.setEmailFrom("bip_admin@oracle.com");
        em.setEmailCC("kanaugust@gmail.com");
        em.setEmailBody("Test");
        DeliveryRequest dr = new DeliveryRequest();
        dr.setEmailOption(em);
        ScheduleRequest sreq = new ScheduleRequest();
        //Set DeliveryRequest
        sreq.setDeliveryRequest(dr);
        //Set ReportRequest
        sreq.setReportRequest(req);
        sreq.setNotificationTo(kanichiro.nishida@oracle.com);
        sreq.setSaveDataOption(true);
        sreq.setSaveOutputOption(true);
        sreq.setScheduleBurstringOption(false);
        sreq.setSchedulePublicOption(true);
        sreq.setUserJobName("WebService Job1");

        String job_id ="";
        try {
            job_id = publicReportService.scheduleReportInSession(sreq, sid);
            System.out.println(job_id);
        } catch (InvalidParametersException_Exception ie) {
            System.out.println(ie);
        } catch (AccessDeniedException_Exception ae) {
            System.out.println(ae);
        } catch (OperationFailedException_Exception oe) {
            System.out.println(oe);
        } 
        return job_id;
    }

    }