Thursday, May 2, 2013

OBIEE11g - Drop down reports


Aim is to select a report from the drop down list and open a report in a new window


This exercise is carried out on OBIEE 11g version.


First of all I am going to open few existing reports and copying the URLs in the address bar of the IE. We have to use those URLs in the java script code shown below.


In the code - I have copy pasted the URLs of the 4 existing reports on my machine - look at the Option value tag and have done some kind of formatting. 


You can replace the URLs by URLs of your own reports and check if that works or not.
 Here I want the report to be opened in a new window and hence the window.open(newPage) in the java scription function GOTO()


Put this code in the Text object of Dashboard editor and check the HTML option.





<html>
<SCRIPT LANGUAGE="JavaScript">
<!--
function GOTO(frm) {
    var newPage = frm.url.options[frm.url.selectedIndex].value
    if (newPage != "None") {
            window.open(newPage)
    }
}
//-->
</SCRIPT>
<table width="1200" border="7" >
<tr>
<td style="background-color:#FFB089;">
<h3>SELECT A REPORT FROM THE DROPDOWN LIST AND PRESS GO</h3>
</td>
</tr>
</table> <br /><br /> 
<FORM>


<SELECT  NAME="url" WIDTH=20>
<OPTION VALUE="None">Select a report >>>


<OPTION VALUE="http://usblrnmehandal1:7001/analytics/saw.dll?PortalGo&Action=prompt&path=%2Fshared%2FRRR%2FColumnSelector">
Column selector report


<OPTION VALUE="http://usblrnmehandal1:7001/analytics/saw.dll?PortalGo&Action=prompt&path=%2Fshared%2FRRR%2FDistrictSelector">
District selector report


<OPTION VALUE="http://usblrnmehandal1:7001/analytics/saw.dll?PortalGo&Action=prompt&path=%2Fshared%2FRRR%2FInline%20Prompt">
Inline prompt report


<OPTION VALUE="http://usblrnmehandal1:7001/analytics/saw.dll?PortalGo&Action=prompt&path=%2Fshared%2FRRR%2F25th%20Percentile">
25 percentile report


</SELECT>
<INPUT TYPE=BUTTON VALUE="Go!" onClick="GOTO(this.form)">
</FORM>
</html>















We have selected here Inline Prompt report and pressed Go.