Tuesday, April 13, 2010

OBIEE Showing Data on a Calendar

Sometimes there's need for the business data related to promotional events, holidays etc. to be presented on a calendar to improve readability. In this post I will explain how to achieve this in OBIEE using mooTools and javscript calendar (

Here's Sales report of an ogranization by day. Wouldn't it be great if we can plot this on a calendar and higlight the day when it's holiday.

To render the calendar we will need mooTools Core, mooTools More and mooTools events calendar. Here are URLs for download: (I used No Compression for all downloads)

MooTools Core:
MooTools More:
Select Date, Scroller, Tips while downloading mooTools More.
Events Calendar:

Here's the list of all files you should have after download:
  • mooECal.css
  • mooECal.js
  • mooECalLarge.css
  • mooECalSmall.css
  • mootools-1.2.4-core-nc.js
  • mootools-
Create a folder name mooTools on OBIEE server under Drive:\OracleBI\oc4j_bi\j2ee\home\applications\analytics\analytics\res\ folder and copy all the files to it.

Narrative View to render Calendar
I added Narrative View to the report I showed earlier.

Added following information to each textbox and selected "Contains HTML Markup" checkbox.


<link rel="stylesheet" type"text/css" href="./res/mooTools/mooECal.css">
<script language="javascript" src="./res/mooTools/mootools-1.2.4-core-nc.js"></script>
<script language="javascript" src="./res/mooTools/mootools-"></script>
<script language="javascript" src="./res/mooTools/mooECal.js"></script>
<div id="calBody"></div>
<script language="javascript">

function getDiv(holFlag)
return '<div style="background-color:#990000;color:#ffffff;">';
return '<div>';

new Calendar({calContainer:'calBody', newDate:'1/21/2010',
cEvents:new Array(

title: getDiv('@3') + '@4</div>',
start: '@2',
end: '@2',
location: ''

Row Separator:

}); </script>

Please note:
  • The path to .js and .css files is ./res/mooTools.
  • getDiv function returns div tag with red background when it's holiday. You can do other event specific handling if required.
  • Calendar instance is passed an array of events. In our case this is sales information.
    Sales value is passed in the title. Start and End date are sale date.
  • The comma (,) in Row separator will separate event array element.
  • You can change mooECal.css in prefix section to mooECalSmall.css or mooECalLarge.css if you want smaller or bigger calendar.

Here's data rendered on calendar. Note, background color for holidays.

Please read licensing terms of mooTools and event calendar before making commercial use.


  1. Nice article thanks for sharing with us.

  2. Nice! Very Nice!


    1. Hey John,

      Did you try this in 11g? Can you tell me to which folder should i copy in 11g?

  3. Hitesh,
    I was searching for the same since long time. It is really very use full for me.
    Thank you very much…

  4. Wonderful...Thanks a lot Hitesh


  5. Great Job Hitesh

    Raja V (Anjali)

  6. can't make this work in 11g Calendar is undefined error

  7. This is really good article, thanks for sharing

  8. Good one. I will definitely try this.

  9. What is holFlag ? DashBoard is not showing anything. Please any one explain how work flow of given function
    function getDiv(holFlag)

    and from where it takes value for holFlag ?