Monday, February 8, 2010

I Want My Custom Java Function for Siebel!

Have you ever wanted to create a new customized function and call that from your RTF templates so that you don’t have to implement a same condition or calculation logic again and again with many different reports ?

I talked about this yesterday a little bit, but I had this problem when I was developing the Siebel reports and had to implement a date formatting or do some date related calculations. As I discussed yesterday that the Siebel  Integration Object generates the date data in its own format like ‘08/15/2008 09:20:11’ unlike the ‘Canonical’ format that BI Publisher expects, which is something like ‘2008-08-15T09:20:11’. Please check the previous post for the detail.

At the previous post, I have suggested two options to workaround this and talked about the first option with ‘totext()’ function. Today, I’m going to talk about the second option, which is to develop a Java custom function and use it in the RTF template.

Develop Custom Extended Java Function

BI Publisher supports the Java custom function that the users can develop their own functions with Java and call it from the RTF template. This will allow the users to hide tedious or complex calculation/business logic and centralize them in a single place, which not only improves the development productivity but also reduce the maintenance headache.

So, how to develop the Java custom function ? Luckily, Mr. BIP, Tim Dexter, has already talked about how to develop the custom Java function at his blog. Please check his post for the detail. At this post I’m going to talk about how to create one to convert the Siebel’s date data to BI Publisher’s ‘Canonical’ date format.

Here is the example of the function does the conversion.

package oracle.bip.extensions;

public class BIPExtensions {
    public BIPExtensions() {
    }
  
    public static final String convertDate(String cdate){
        String conv_date = "";

        if(cdate.length() == 11){
            conv_date = cdate.substring(6,10)+"-"+cdate.substring(0,2)+"-"+cdate.substring(3,5);
        }else if(cdate.length() == 19){
            conv_date = cdate.substring(6,10)+"-"+cdate.substring(0,2)+"-"+cdate.substring(3,5)+"T"+cdate.substring(11,19);
        }else{
            conv_date = cdate;
        }
        return(conv_date);
    }

}

The example above is a pretty simple one for a demo. It gets the Siebel given date, convert it to the ‘Canonical’ date formatted string, and returns. If the given date contains only the ‘MM/DD/YYYY’ portion then it returns only the date in ‘YYYY-MM-DD’ format. If it contains the time data also then it returns ‘YYY-MM-DDTHH:MI:SS’.

This is just an example. So of course you can develop anything you want and develop as many functions as you want in the same class. Once you completed the development you can compile it and deploy it to a JAR file.

At this point, the next thing you want to do is to test the function with your RTF template. There are three steps to follow.

Setup Your MS-Word Add-in Template Builder Environment

I have talked about how to setup the MS-Word Template Builder environment so that we can use the Siebel’s extended functions at this post, ‘Siebel’s Extended Function for RTF Template’.

Basically we need to do the same thing in order to use the above custom function. So what we need to do is to add one more JAR file location in the ‘_JAVA_OPTIONS’ variable in the MS-Word launch batch script file. Here is the example assuming that the JAR file is called ‘BIP_Extension.jar’ and located under ‘C:\JDeveloper\mywork\Local\Project1\deploy\’.

echo %1

set _JAVA_OPTIONS=-Xbootclasspath/a:D:\811DQSSIA\client\classes\SiebelXMLP.jar;D:\811DQSSIA\client\classes\XMLP.jar;D:\811DQSSIA\client\classes\siebel.jar;D:\811DQSSIA\client\classes\XSLFunctions.jar;D:\811DQSSIA\client\classes\SiebelCustomXMLP.jar;D:\811DQSSIA\client\classes\SiebelCustomXMLP_SIA.jar;C:\JDeveloper\mywork\Local\Project1\deploy\BIP_Extension.jar

"C:\Program Files\microsoft office\Office12\Winword.exe" %1

Now you can double click this .bat file to open your RTF template.

Declare a Name Space for the Extended Function

As mentioned in the ‘Siebel’s Extended Function for RTF Template’ post, you need to first specifying the custom class file by declaring its name space with the class path.


<?namespace:bipext=http://www.oracle.com/XSL/Transform/java/oracle.bip.extensions.BIPExtensions?>

Use it!

Once the name space is declared then you can use it as the same way you use the ‘xdoxslt’ or ‘xdofx’ functions. Type the name space first then type the function. Here is an example.


<?bipext:convertDate(ssCreatedDate)?>

My convertDate function takes an input parameter value of date string so I set a XML element name that holds the date data.

And after you ensure that the functions works appropriately then you can deploy it to the server side following the steps at ‘Siebel’s Extended Function for RTF Template’.

Conclusion

So now you got this whole freedom of developing and adding your functions to the BI Publisher’s reports development realm. However, note that as I suggested before you should review the existing BI Publisher’s native functions and the Siebel’s extended functions first to see if they can be used to meet your requirements. Developing your own new functions means you will be responsible for the maintenance. And it’s not uncommon that one developer develops something and leave after a project is completed, then the other members left alone have no idea how to fix it when a problem occurred with the custom functions. As long as you use the functions provided by Oracle then Oracle will be responsible for the fix. That’s the difference you want to consider for the long term.

Keep that in your mind have fun with the custom Java function !

Friday, January 29, 2010

My Date doesn’t like me with Siebel !

 bizarro-play-date

Are you doing ok with your date in the Siebel reporting with BI Publisher ?

If you are coming from Siebel this might make you kind of confused because the BI Publisher user’s guide tells you it supports all sorts of the date formatting and date related calculations but somehow it doesn’t work when you try with the Siebel reports. If you are coming from BI Publisher reporting world you might have figured out why it doesn’t.

BI Publisher provides quite various of ways of the date formatting and date related calculations. You can find the detail from the BI Publisher’s Reports Designer’s Guide. Here is a section for the date formatting. And here is a section where you can find the date related functions that you can use to do the date related calculation.

However, in order for BI Publisher to do the date formatting or the calculation the date data (in the XML data) needs to be presented as something called ‘Canonical’  format, which is something like ‘2008-10-09T05:31:13.000-04:00’. The example contains Year, Month, Day, Time, and Time zone difference from GMT. It doesn’t need to contain the time and the time zone difference parts, but it needs to have the date part at least. And it needs to be in ‘YYYY-MM-DD’ or ‘YYYY-MM-DDTHH:MI:SS’ format.

And now, the date data generated by Siebel with the IO is in ‘MM/DD/YYYY HH:MI:SS’ format, so it is something like ‘10/09/2008 05:31:13’. And BI Publisher doesn’t recognize that this is a date data because it’s not presented in the ‘Canonical’ format!

Due to this fact, not only you can’t do the date formatting but also you can’t do the date related calculation. For example, you might want to print number of day between two presented dates like start date and end date. If the those two date data is presented in the ‘Canonical’ format then you can use something like ‘date_diff()’ function to get the duration counted between the two dates. But it doesn’t do anything or you get an error if you provide those two dates not in the ‘Canonical’ format.

There is a discussion in the Siebel reporting product development that this might be addressed in the next Siebel FixPack by having IO returning the date in the ‘Canonical’ format. But it’s not determined yet and guaranteed.

So what should we do now ? There are two possible and reasonable workarounds to overcome this issue. The first one is to use one of the Siebel’s extended function ‘totext()’ to convert the Siebel date format to the ‘Canonical’ date format before the BI Publisher’s date related function comes in. Here is an example of how to use to convert the date.


psfn:totext(ssCreated,"yyyy-MM-dd","MM/dd/yyyy")

The above example is giving the Siebel date data, telling what date format the presented date data in, and telling how to convert. So if the ‘ssCreated’ is ‘10/09/2008’ then it would return as ‘2008-10-09’, which is the ‘Canonical' date format. Once you get your date data in the ‘Canonical’ format then you can do the date formatting or use the date functions to meet your requirements.

The advantage of this option is easy and quick to implement and you don’t need any customization. The disadvantage of this option is that as you see it gets messy especially when you want to do a date related calculation in a complex business logic because you need to specify the date formats every time you use it.

The second is to develop a custom Java function to convert the date from, the Siebel’s date format to the ‘Canonical’ date format. As you might know BI Publisher supports a way for you to develop custom functions with Java and use them in the RTF template. The advantage of this option is clean and easy to use. The disadvantage is that you need to develop the Java code and deploy it to the server, which might require the system administrator’s help if you don’t have an access to the server instance.

So now, at least you can get your date data work in the Siebel reports! And I will discuss on how to develop the custom Java function for Siebel reports tomorrow. So again, stay tuned!

Wednesday, January 27, 2010

What to Do with these Siebel Extended Functions?

After you run the Actuate to BI Publisher conversion utility and open the generated RTF template file you would find something like below in the text forms, though it depends what you had in your old Actuate report.

<?value-of:concat(concat(ssActiveFirstName," "),ssActiveLastName)?>

<?value-of:psfn:Format(psfn:CInt(TotalCommit1),"$#,##0")?>

<?value-of:concat("Printed on: ",psfn:Format(psfn:currentdate(),"mm/dd/yyyy"))?>

And when you try to preview with your MS-Word with BI Publisher Add-in, you’ll get an error.

First of all, when you try to preview the report after loading a sample XML data by using the MS-Word add-in (Template Builder) you need to follow some steps that I discussed yesterday.

Second, the ‘value-of’ just doesn’t work. I don’t even know why they are there. But the good news is you can just get rid of them!

And now, assuming that your MS-Word Add-in has already been setup correctly and you have declared the ‘psfn’ name space in your RTF template, the next step is to figure out ‘what the hell are these functions doing?’

The conversion utility generated those codes with the Siebel’s extended functions doesn’t mean that you need to use them as they are. Most of the functions are covered and can be replaced by the BI Publisher’s existing functions so no need to use the Siebel’s. I would recommend to use the BI Publisher’s ones over the Siebel’s ones due to a long term maintenance advantage. However, some of the functions are not provided by BI Publisher, then you want to stick with the Siebel’s extended functions like the ones I recommended yesterday.

So What to Do with These Syntax?

Well, this really depends on each case but here is a list of the steps that you can take to reach to the answer.

  1. Understand what it’s trying to do
  2. See if there is any BI Publisher’s native function that can be used to provide the same functionality
  3. If yes to the #2 question then replace and test
  4. If no to the #2 question then see if it works without any modification
  5. If no to the #4 question then come up with a logic by using BI Publisher’s native function or developing a new custom Java function

1. Understand What It’s Trying to Do

You can guess what it’s trying to do just by looking at the generated code. But it’s always better to see the original logic in the Actuate report definition. And it’s even better to review the original business requirement. Often that the requirement has been changed over the years and some of the logic might not be relevant anymore. If that’s the case you definitely don’t want to spend any of your time on something that is not meeting today’s requirements.

2. See if there is any BI Publisher’s Native Function

Once you understand the requirement and what the syntax is trying to do then review the BI Publisher’s function list to see if any of the functions can replace it without compromising the requirement.

3. Replace It and Test It

No much to talk about here, but go ahead replacing it and make sure the result is meeting the expectation.

4. Leave It As It Is and Test It

If you can’t find any BI Publisher’s function that can replace it then try to use it and see if it works. If it works then great, but I had some functions that didn’t work (e.g. CnvDate), and later I was told that they were not even supported! So it’s important to setup your MS-Word and test it on your local environment before uploading it to the Siebel server.

5. Come up with a New Way

If you can’t find any BI Publisher’s function that can replace and the Siebel’s extended function doesn’t work then you need to come up with a way to make it work to meet the requirements. With BI Publisher’s flexible development framework usually you should be able to find a way easily to achieve this by combining the existing functions or XSL/XPath functions and creating a logic.

As a long term solution though, if you see this function or logic can be used in many other reports, then you might want to think about developing your own Java custom function. BI Publisher supports such custom function being developed by Java and being used in the RTF template. I will cover this later this week.

Now let’s see what we can do with those in the above example.

What Can We Do With the Examples

Example 1:

Here is the first one.


<?value-of:concat(concat(ssActiveFirstName," "),ssActiveLastName)?>

This one is simply trying to print First Name and Last Name in this order and have one space between so the result would be something like below.

Barak Obama

As most of you know this is where it becomes so easy to develop and design with BI Publisher. What you need to do is just this.


<?ssActiveFirstName?> <?ssActiveLastName?>

You can either use the two text forms (the gray square box ones) or just type the above, and adjust the space between in the MS-Word.

Example 2:

Here is the second one.


<?value-of:psfn:Format(psfn:CInt(TotalCommit),"$#,##0")?>

This one is trying to do the number formatting in this ‘$9,990’ format. And CInt is trying to ensure that the data is always passed as number. You can simply replace this by get rid of all but the ‘TotalCommit’ data element like below.


<?TotalCommit?>

Then use the BI Publisher’s property UI where you can specify your desired number format.

Example 3

And here is the last one.


<?value-of:concat("Printed on: ",psfn:Format(psfn:currentdate(),"mm/dd/yyyy"))?>

This is trying to print the current date as a ‘Printed’ date so that the users know when this report is generated. There are actually many ways to print the ‘Current date’ with BI Publisher. And here are some examples.

<?xdofx:sysdate()?>

<?xdoxslt:current_date($_XDOLOCALE, $_XDOTIMEZONE)?>

<?xdoxslt:sysdate_as_xsdformat()?>

The date formatting itself is a whole another topic and I leave the detail to another post later. But you can use one of the above to return the current date and use the BI Publisher’s property UI, the one pop up when you double click the gray box, and specify your desired date format. And again, you don’t need the ‘concat’ function to concatenate the two strings. You can simply type the ‘Pritned on: ‘ and have the text form box next which includes one of the above syntax.

Conclusion

The chances are you will have more and various different requirements and can have the RTF templates generated with more various and can be funky syntax. Hope this post help you to get started and give you a starting point and make your reports development more enjoyable.

Tuesday, January 26, 2010

Siebel’s Extended Function for RTF Template

Has anyone noticed some funky functions after you converted the BAS (Actuate) files to BI Publisher’s RTF template ? These functions look confusing especially for some of us coming from pure BI Publisher side. And even worse, they are most likely throwing errors at you when you try to preview with the MS-Word Add-in Template Builder!

So what are these? Well, these functions are there to help you to provide easier way to achieve some of the Siebel specific requirements. However, there are many functions that now we can just use BI Publisher’s out-of-box functions instead. And some functions just simply don’t work due to some defects with the conversion utility.

So it’s important to identify what functions we can use, when to use them, and how to use them.

What Functions Can We Use ?

There are about 30 or so of the Siebel extended functions in total. But most of them are actually either not really useful or duplicate of already existing BI Publisher’s functions. I couldn’t get an approval to share the list with public so I can’t list them here. But again, most of them are not really useful so I’ll list only those that are useful for the Siebel reports development at the next section.

When to Use Them ?

Among all the Siebel’s extended functions here is a list of the functions that I personally find useful.

Function Name Description Example
DivIntZero(int div, int divisor) Method returns a 0 if the divisor is a zero. <?psfn:DivIntZero(10, 0)?>
now() Method to return the current time in the native time format. <?psfn:now()?>
phoneFormat(java.lang.String inp) Method to returns a String, which is the usual way to display the phone or fax number i.e. (XXX)AAA-BBBB <?psfn:phoneFormat(ssPhone)?>
totext(java.lang.String d,java.lang.String f,java.lang.String e) Method to return the date "d" the format "f" of the input date, which is in format " e ". format yyyy-MM-dd. <?psfn:totext(ssCreated,"yyyy-MM-dd","MM/dd/yyyy")?>
Val (java.lang.String input) Method to Returns the numeric value of a string expression. <?psfn:Val(ssAccountName)?>

Now, you might have the following two questions.

  • Ok, those look useful and I want to use them. But is there any pre-configuration or pre-requisite steps ?
  • I see bunch of functions in my RTF template that was generated by the conversion utility, what should I do with them ?

So let’s talk about what pre-requisite steps required to use the Siebel extended functions. Then later I’ll discuss about what to do with the automatically generated functions in the RTF template.

What are the Pre-Requisite Steps to Use Siebel Extended Functions ?

There are three steps to ensure in order for you to use the Siebel extended functions.

  • Configuration at Siebel Server
  • Configuration at BI Publisher Enterprise Server
  • Configuration at Client (BI Publisher MS-Word Add-in)
  • Declare the Siebel Extended Function in each RTF template

Configuration at BI Publisher Enterprise Server

There are a couple of JAR files that come with the Siebel server installation. And you need to make these JAR files available to your BI Publisher server instance so that at the runtime the BI Publisher Server can use the JAR files to execute the Siebel’s extended functions. So make sure you have those JAR files, which are listed below, under the BI Publisher’s Server’s Java library folder. (e.g. OracleAS_HOME/j2ee/home/applications/xmlpserver/xmlpserver/WEB-INF/lib)

  • XSLFunctions.JAR
  • SiebelCustomXMLP.JAR
  • SiebelCustomXMLP_SIA.JAR

Then you need to enable ‘External File Reference’ from the BI Publisher Server UI.

  1. Log in to the Oracle BI Publisher Server with administrator privileges.
  2. Click the Admin tab, and then select Runtime Configuration and Properties.
  3. Change the default value for the Disable External Reference attribute to FALSE, click Apply, and then verify the changes were made.

The detail configuration for BI Publisher Enterprise Server is documented here.

Configuration at Siebel Server Side - Adding an Explicit Reference to JAR Files for the Oracle BI Publisher Server

This requires for the scheduling functionality to work with the functions. You can find the detail setup from here.

Configuration at BI Publisher client (MS-Word Add-in Template Builder) side

If you want to use the Siebel’s extended functions in your RTF template and preview with the MS-Word Template Builder you will get an error without the steps I’m going to talk about here. There are two things to do. You need to configure your Template Builder environment, which requires only for the first time, and need to declare the Siebel function name space in the RTF template for these functions to work.

Create a Batch File to Launch MS-Word Associating with the Siebel’s JAR files

Basically, you need to add a set of Siebel jar files to ‘_JAVA_OPTIONS’ variable and call MS-Word for these functions to work in your Template Builder instance. Here is an example script that you can use to launch MS-Word with the variable setting. 

echo %1

set _JAVA_OPTIONS=-Xbootclasspath/a:C:\81DQSSIA\client\classes\SiebelXMLP.jar;C:\81DQSSIA\client\classes\XMLP.jar;C:\81DQSSIA\client\classes\siebel.jar;C:\81DQSSIA\client\classes\XSLFunctions.jar;C:\81DQSSIA\client\classes\SiebelCustomXMLP.jar;C:\81DQSSIA\client\classes\SiebelCustomXMLP_SIA.jar

"C:\Program Files\microsoft office\Office\Winword.exe" %1

Note that the above ‘set _JAVA_OPTIONS’ line must be a single line, no return key. You can find the detail of this configuration here from the configuration guide.

Once you have created the above script as a .bat file then you can double click this .bat file to start MS-Word and open your RTF template. In order for this configuration to work you need to shutdown all the MS-Word documents first and start MS-Word by clicking this bat file.

Declare Siebel’s Extended Function Name Space in RTF Template

Before you start using the extended function, first you need to declare a name space called ‘psfn’ as below in your RTF template.

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

You need to declare this in every single RTF template file where you want to use the extended functions.

Now you’re ready to start using the Siebel’s extended functions!

How to Use Siebel Extended Functions?

You can use the Siebel’s extended functions as the same way you use other BI Publisher’s functions. Here is some example.

<?psfn:DivIntZero(10, 0)?>

<?psfn:now()?>

<?psfn:phoneFormat(ssPhone)?>

<?psfn:totext(‘ssCreated’,"yyyy-MM-dd","MM/dd/yyyy")?>

You just need to start with ‘psfn:’ name space before the function. And you can preview the report output with a sample data that you have downloaded from the Siebel server UI (Web Client).

When you preview it you should be able to see the values from your sample XML data being calculated or formatted by the functions.

Troubleshooting:

1. I’m getting an error with ‘Namespace prefix 'psfn' used but not declared.’

Caused by: oracle.xdo.parser.v2.XPathException: Namespace prefix 'psfn' used but not declared.

As mentioned above you need to make sure that you have declared the Siebel’s extended function’s namespace in the RTF template. 2. I’m seeing an error with ‘method not found’ when trying to preview

2. I’m getting an error with ‘method not found’ when trying to preview.

If you are still seeing an error saying ‘method not found’ then you should make sure that you close all the MS-Word document completely then double click the custom MS-Word launch program (.bat) and open the RTF template file.

Conclusion

Once your RTF template is ready now you can upload it to the server and run it from the Web client. But you want to make sure that the server side configuration, which was mentioned above, has been done properly for these functions to work.

Hopefully now you understand how to use the Siebel’s extended functions within both the runtime and the development sides.

I still haven’t answered to one of the questions I raised above.

‘I see bunch of functions in my RTF template that was generated by the conversion utility, what should I do with them ?’

The Actuate to BI Publisher Conversion utility generate the RTF templates with many of the Siebel’s extended functions. So I will discuss about what to do with them tomorrow. Stay tuned!

Friday, January 15, 2010

What’s the Latest with Siebel Actuate Reports Conversion Utility?

 jobsmacbookair

I have talked about the Actuate to BI Publisher reports conversion for Siebel by using the Actuate Migration Utility at this blog before.

However, that was more than a couple of months ago therefore we’ve got some updates with the latest Actuate to BI Publisher reports conversion utility. Now the tool can generate Integration Objects (IO) based on the Siebel reporting object, which is quite useful because most of the existing custom reports use the reporting objects to generate the reporting data in the old Actuate based reporting framework.

So let me go through the reports conversion at very high level. The detail can be found in a PDF document that comes with the utility called, ‘Converting Reports from Actuate to Oracle BI Publisher’.

Where you can download?

You can download the Actuate to BI Publisher Reports Conversion Utility from Oracle’s support web site (a.k.a Metalink).

Once you are at the support web site you can type ‘8968224’ as a Patch ID to search the conversion utility. There are different versions for each version of the Siebel release.

Conversion_Tool_List

How to Start?

With this tool you can do two things. One is to convert the reporting objects to the Integration Objects (IO). Another is to convert the Actuate BAS files to BI Publisher RTF template files.

The utility is a Java program so you can technically run it on either Windows or Unix/Linux environment. However, there is a command line script provided to assist you to run the utility easier. And the command line script is only for Windows. So I’d recommend using this command line script on Windows unless you have other special requirements that you can’t.

And since the utility is a Java program, you need to have a JDK or JRE setup on your machine before you run this tool. The JDK/JRE version should be 1.5 or later.

How to Use to Generate IO?

Run the Utility Script

First of all, you need to ensure that you have an ODBC connection to the local Siebel Tools database and that it works fine.

You can use ‘run_IOC’ command script to generate the IO. Here is a sample command line to call the utility’s script to generate an IO


run_IOC –r <Siebel Tools report name> -d <ODBC Datasource Name> -u <DB username> -p <DB password> -l <log file path> -ll <log level> -n <IO name>

The Report Name (-r) and ODBC Data Source Name (-d) are mandatory while other parameters are optional.

Parameter Note
-r Report Name. You can find this name as ‘Access Base DB Name’
-d ODBC Data Source name
-u username for Siebel user ‘SIEBEL’. This is case sensitive.
-p password for Siebel user. This is case sensitive.
-l log file path
-ll log level. The option can be: SEVERE, WARNING, CONFIG, INFO, FINE, FINER, FINEST, ALL, or OFF
-n If you want to override the generated IO name then you can use this option. But it’s better to not use this option so that the IO will be generated with a name starting with ‘BIP_’, which is required to be shown up in the IO list at the report template page.

And here is an example:

run_IOC -r SALES -d SSD -l C:\Conversion\Logs\Sales.txt -ll all

Import IO

Once the Integration Object(s) have been created in Siebel Tools, you can archive the Integration Object(s) into an archive .sif file, delete the Integration Object(s) and then re-import the archive .sif file back into Siebel Tools. This step is necessary to ensure the new repository objects have a unique ROW_ID. This will require the SRF to be compiled.

 

How to Use to Generate RTF Template?

Generate BAS File

First, you need Actuate BAS file to convert to the RTF Template. The Actuate report definition is stored in a ROD file so you need to generate the BAS from the ROD if you don’t have yet. You can generate the BAS files with Actuate eReport Designer. Here is the basic steps.

  1. Open one of your ROD files in the Actuate eReport Designer
  2. Click on Report-Build or press Shift+F8

This will generate BAS file under the same directory where the original ROD (xxx.rod) file is located.

Convert from BAS to BI Publisher RTF Template

Once you got the BAS file now you can call the script called ‘run’ to convert the BAS file to BI Publisher RTF template file. Here is the command line syntax.


run –i <bas filename> -o <output filename> -l <log filename>

Note: The option -i is a mandatory while -o and -l are optional. If you don’t specify then it will generate the RTF template and the log file to the location where you specify for the bas file location.

And here is the example:


run -i SALES.bas -o SALES.rtf -l Sales.log

The above conversion script also supports a batch conversion where you can convert multiple BAS files to BI Publisher RTF Template files. You can specify a folder that contains multiple BAS files instead of a file name. Here is the example.

run -i D:\Conversion\BAS -o D:\Conversion\RTF -l D:\Conversion\Log

Modify and Upload RTF Template

Now you get the RTF template file generated and you can start reviewing it and making necessary changes. Based on my experience it will take some effort to do this manual modification depends on how many scripts are in the original reports and how well the original reports have been kept maintained. Also the conversion utility sometimes generate some functions that don’t work. I will discuss about these manual modification stuff in another post.

Once the manual adjustments are done then you need to register this RTF template to the Siebel server with the Web client and associate it with a View where you want to run this report from.

I will talk about Siebel’s custom extended function next week, so stay tuned!

Wednesday, January 13, 2010

Can We Have BI Publisher Integration for Our Siebel Version without Major Upgrade?

Some of our customers were asking if they needed to upgrade to Siebel R8.1.1.x version from the older release such as 8.0.x, 7.8.x, 7.7.x, to get the new Siebel Reporting with BI Publisher. The short answers is No. You can stay with your older release.

Having worked with many customers projects, I know how tough and can be a long process to upgrade the whole system especially with this type of CRM application. However, the Actuate support through Oracle is expiring so immediate migration to BI Publisher is required.

So now, we have released the BI Publisher integration as part of the Siebel Fix Pack for the older release of Siebel application to provide the same reporting functionality with BI Publisher that is provided in the Siebel R8.1.1.x.

Now you can start enjoying all the functionalities that come with the BI Publisher integration by just applying the Fix Pack listed below.

Here is the list of the Fix Packs that contains the BI Publisher integration.

Release Release Date Functionality
8.0.0.8 Fix Pack 30th September, 2009 Same as 8.1.1.1 Fix Pack functionality
7.8.2.14 Fix Pack 16th October, 2009 Same as 8.1.1.1 Fix Pack functionality
7.7.2.13 Fix Pack 23rd November, 2009 Same as 8.1.1.1 Fix Pack functionality

The latest Siebel Reporting with BI Publisher is 8.1.1.1, which added some new features like, Parameterized reporting, Scheduling. You should be able to find the Fix Pack from the metalink.

Again, the Actuate support through the Oracle support contract is expiring so I’d strongly recommend to upgrade to the version above by applying the corresponding Fix Pack so that you can start migrating the existing Actuate based reports to BI Publisher based reports

All the out-of-box reports have already migrated to BI Publisher based reports and available within the Siebel application. So you need to do the migration only for the reports you have customized or developed from scratch.

I have talked about how to migrate the existing reports at the following two posts if you are interested in.

If you are interested in discussing how to start planning for the migration, best practice approach, outsourcing service, etc, we have many experience and resources in our Oracle BI Publisher consulting group to assist. Please feel free to contact me at kanichiro.nishida@oracle.com.

Tuesday, January 12, 2010

BI Publisher Logging & Debugging - Part 4

There are more topics I would like to talk about on the BI Publisher logging & debugging. Especially there is now a new feature that allows you to enable the 'Report Generation Logging’ option at each report template level. So instead of enabling the logging feature at the server level you can quickly and easily enable the logging feature only for the report you are working without asking for your system administrator’s help!

Also, sometimes you might wonder what exactly the property values are coming to the RTF template. So I also will talk about this in this post. So let’s start with the ‘Report Level Logging Feature’!

Report Generation Logging Option at Report Level

This is a new feature that has been introduced recently with either October or November patch set release. This gives you an option to set if you want to enable the logging and what level of information at the report template level.

I have talked about how to enable the reports generation logging before and that is a setting at the BI Publisher server level. So if you have enabled the feature then all the reports start generating the log when they run.

While enabling the logging feature at the server level is useful when you want to debug all the reports at a testing environment, it might not be ideal when you want to debug only a particular report without impacting other reports’ performance. In order to turn on or off the logging feature at the server level you need to restart the server, which again might not be ideal when you need to find and ask the system administrator and wait for the next restarting schedule.

With this report level setting you can simply enable the report logging feature only for the reports you’re interested in and no need to wait for the server restart. 

How to Set the Logging at Report Level?

You can simply add a BI Publisher command called ‘xdo-debug-level’ in your RTF template. Here is an example.

<?xdo-debug-level: debug_level?>

The ‘debug-level’ should be replaced by one of the following options.

  • STATEMENT - This log write all the reporting running process information.
  • PROCEDURE - This will log only the procedure level information. This is required to measure the time consumed per each process.
  • ERROR - This will log only the error related information.
  • OFF - This will not log any information.

Example:


<?xdo-debug-level:"STATEMENT"?>

The debug_level value is not case sensitive so it can be either upper or lower case. For example, <?xdo-debug-level:"STATEMENT"?> or <?xdo-debug-level:"statement"?>.

The debug log directory will be generated in one of the following locations:

  • <system-temp-dir>/xdodebug
  • <java.io.tmpdir>/xdodebug (if system-temp-dir is not defined

Again, this setting can be done at the template level, this mean you can either modify the existing RTF template by adding the above command or create a new template which contains only the above command if you’re interested only in debugging the data model or parameter values generation part.

How about XSL Template?

If you are using the XSL Template instead, then you can add ‘<!--xdo-debug-level="statement"-->’ in the first 500 character of the template file.

How to See What Property Values are Passed in RTF Template?

Sometimes you wonder what exactly the values are passed to your RTF template. For example, when you set a custom variable at the server level and try to get the value to do a further operation in the template, it might work or not work the way you wanted. And you want to see if the value is really set and being passed to your template.

There is a very useful command to address this concern. You can simply type the following command in your template.


<?xdoxslt:getXDOProperties($_XDOCTX)?>

And you can upload the template and run from the BI Publisher Server UI. You should get something like below in your report output. 


xslt.CURRENT_SERVER_SCHEME='http'
html-image-dir=C:\OracleBI\oc4j_bi\j2ee\home\applications\bip\xmlpserver\xdo/tmp/
fo-external-link-target=_blank
html-css-dir=C:\OracleBI\oc4j_bi\j2ee\home\applications\bip\xmlpserver\xdo/tmp/
system-temp-dir=C:\OracleBI\oc4j_bi\j2ee\home\applications\bip\xmlpserver\xdo/tmp/
xslt.XDO_USER_ROLES='XMLP_TEMPLATE_DESIGNER,XMLP_ANALYZER_EXCEL,XMLP_ADMIN,XMLP_ANALYZER_ONLINE,XMLP_DEVELOPER,XMLP_SCHEDULER'
xslt.CURRENT_SERVER_PORT='9704'
xdk-secure-io-mode=true
xslt.CURRENT_SERVER_URL='http://knishida-lap.us.oracle.com:9704/bip/'
fo-external-link-base-url='http://knishida-lap.us.oracle.com:9704/bip/POC/'
xslt.XDO_USER_NAME='administrator'
xslt.HOSTPORTPATH='xdo.us.oracle.com/temp'
xslt._XDOCHARTTYPE='image/png'
xslt.CURRENT_SERVER_CONTEXT_PATH='bip'
xslt._XDOOUTPUTFORMAT='text/html'
xslt.HTTPSERVER='knishida-us.oracle.com:9704'
html-css-base-uri=http://knishida-lap.us.oracle.com:9704/bip/xdo/tmp
xslt._FURL='http://knishida-lap.us.oracle.com:9704/bip/POC/'
xslt._xdo_user='administrator'
xslt._xt='New Template 1'
xslt._XDOHTTPSERVER='knishida-us.oracle.com:9704'
html-image-base-uri=http://knishida-lap.us.oracle.com:9704/bip/xdo/tmp/
xslt.CURRENT_SERVER_NAME='knishida-lap.us.oracle.com'
xslt._xf='html'
xslt._XDOLOCALE='en-US'
xdodebug.LogDir=C:\OracleBI\oc4j_bi\debug


All the above variables are available for you to use in your RTF template. And you can see the values if they are the ones you were expecting or not.