Thursday, 31 May 2012

Page Number in OBIEE

Many questions arise in OTN for displaying Page numbers like the one below:











My method below is not so good for everybody to display the page numbers. But was working good for my requirement. But Yes, little java script made a big difference. I hope people out there whose design is as simple as I have posted below, for them it would work great. Otherwise atleast they can get a good idea of the things how to work on.


First, I pull a dimension column and a fact column and also pull two other columns for displaying page number and total page number.

With column formula as

cast(ceiling(cast(max(rcount(Column_Name)) as double)/25) as int)
cast(ceiling(cast(rcount(Column_Name) as double)/25) as int)


Pull two narrative views and place them accordingly.
1st narrative view is for displaying the dynamic page numbers. Here in my case, I conside first 25 records(default) as a single page.



2nd narrative view is for displaying the total page number.


<head>
<script type="text/javascript">
var count1=0;
var classname1 ="TTHC PTLC OORT";       
var element = document.getElementsByTagName('td');
for (var i = 0; i < element.length; i++)
{
var classes = element[i].className; 
if (classes==classname1)
{
count1=count1+1;
if(count1==1)
{
var parentnode1=element[i].parentNode.childNodes[5];
alert(parentnode1.innerHTML);
}
}
}

var element1 = document.getElementsByTagName('td');
var count=0;
var classname2 ="CVFormatCell";
for (var j = 0; j < element1.length; j++)
{
var classes1 = element1[j].className;
if (classes1==classname2)
{
count=count+1;
if(count==2)
{
var parentnode2=element1[j].parentNode.childNodes[0];
alert(parentnode2.innerHTML);
parentnode2.innerHTML=parentnode1.innerHTML;
}
}
}
</script>
</head>


You need to have the HTML code for the page and search for the respective tags to replace. I am replacing the third column ie the dynamic page number value into the 1st narrative view.

And place the javascript at both the report level and page level. For page level it is required for displaying for the first time and report level for changing dynamically.


So now the magic to begin. Below is the first page with 25 records


When we click on the next page then javascript inside the report plays into action and replaces the values.



But more important is you need to hide the last two columns with white font and keep it at the last of the report. I know this has limitations but still we need to meet the requirement ;)

Hope this triggers many minds further :)


Images in Ticker with Hyperlink

Check my first post here before continuing your further reading-
http://obiee10grevisited.blogspot.in/2012/05/images-in-ticker.html
Reply for OTN question-
https://forums.oracle.com/forums/thread.jspa?threadID=2396131&tstart=0

When images needs to be added in the ticker and depending upon the image click it has to navigate to separate reports. I am using <a href> inside the column formula-

'<a href="../analytics/saw.dll?Answers&Action=results&path=Pathofreport1">
<img src="../analytics/res/s_blafp/images/report_account_appl.jpg" width="150" height="40" />
</a>
<BR>
<a href="../analytics/saw.dll?Answers&Action=results&path=Pathofreport2">
<img src="../analytics/res/s_blafp/images/report_activities.jpg" width="150" height="40" />
</a>'

Check the HTML in the Data format.
And if the image still doesnt appear then restart the Services. And blue border should appear around the image.
Then just have the ticker and it works as expected.



The above is tried in obiee 11g only.

Images in Ticker

When images needs to be added in the ticker. Then I thought to use them in the column formula and then have a <br> to separate the images.

'<img src="../analytics/res/s_blafp/images/report_account_appl.jpg" width="150" height="40" /><br>
<img src="../analytics/res/s_blafp/images/report_activities.jpg" width="150" height="40" />'

Then just have the ticker and it works as expected.



Paths for Custom Images in 11g

Drive:\Oracle\Middleware\Oracle_BI1\bifoundation\web\app\res\s_blafp\images

Drive:\Oracle\Middleware\user_projects\domains\bifoundation_domain\servers\bi_server1\tmp\_WL_user\analytics_11.1.1\7dezjl\war\res\s_blafp\images

Drive:\Oracle\Middleware\user_projects\domains\bifoundation_domain\servers\AdminServer\tmp\.appmergegen_1291264099332\analytics.ear\ukjjdc\res\s_blafp\images

The above is tried in obiee 11g only.

Saturday, 26 May 2012

Displaying Any Record by Default

Hi All there...

When user requests to see any record as the default value, ie even if any value is selected/ not selected in the prompt.

To display the column at the top always-
If the records are limited then you can use case statements in a separate column and sort them to show the first record at the top, else you need to go for sort column in the BMM layer RPD.
I used case statement and hidden it.
In the dashboard prompt you need to specify the presentation variable name. So that the variable value is also passed to the report. In 10g only one value can be passed, but in 11g you have the option to pass multiple values to the report through the presentation variable.


In the report criteria, you need to specify the filter values as
column_name equal to presentation variable
or equal to the Default value (in my case its Type 4).



Now pull both the prompt and report. 




By default the report shows Type 4 value as the presentation variable value is not passed.
Now when we click on the prompt value then Type 4 as well as value selected appears.



There can also be various other ways. Explore them and post them... 


Changing the Language in OBIEE on the Fly

Many would have come into a situation to change the Language on the fly without logging out everytime.


Use the below code after your link to change the language.
"Dashboard&Lang=fr"
Here fr refers to the French Language.
So similarly you can change for other languages :)



But remember only the default values of the OBIEE Application will be changed, but if you need to change the column names, you need to have a translation table for that (multi-lingual feature).

Hope this helps :)








Tuesday, 22 May 2012

Copy views data to clipboard in OBIEE 11g

In 11g, when we try to copy the data from the analysis and try to paste elsewhere, it doesnt allow to do so.



What you can do is- You can try giving action link navigation to a new report.









In the dashboard, you place the report with action link navigation to the static text dummy report and after that it allows to copy the data from the analysis and allows to paste else where.


You need to select the text from the starting position of the first character .Yes, its difficult. :) You need to drag on the text/ data/ value in the row by clicking the left button and holding it till the end.
If suppose, the user, by mistake clicks on the values while selecting the text/ data then he/ she will be navigated to the dummy report from where they can navigate back.



Tuesday, 15 May 2012

Disabling Right Click on OBIEE with javascript

We had to disable the right click button of mouse.
Thansk to Javascript ;)

<script language=JavaScript>
<!--
var message="Function Disabled!";

function clickIEbrowser4(){
if (event.button==2){
alert(message);
return false;
}
}
function clickNSbrowser4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
return false;
}
}
}
if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNSbrowser4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIEbrowser4;
}
document.oncontextmenu=new Function("alert(message);return false")
</script>

Master Detailed report on the same page. Navigate to the same page/ window


We had a requirement where Master and Detailed report should be shown on the same report on click of the measure value as shown below.


Initially, I have built a Master report and gave navigation to the same page.


In the Detailed report made the columns as 'is prompted' and kept the two reports in two different sections.



Built one intermediate report for the validation. That is, generally the detailed report should not be shown to the user, when the user clicks on the measure value then only the Detailed report should be visible at the below of the Master Report.


In the Detailed report section in the 'Edit Dashboard' gave the condition with reference of the Intermediate report and gave the condition as "equal to 1".So that the report is not visible at the initial view to the user. And save the page.

Now when the user clicks on the measure value then it navigates to the same page, but the values is passed to the detailed report as it contains 'is prompted'.


Hope this helps alot people out there.

Sunday, 13 May 2012

Local OBIEE 11g link not starting

Wehn I restarted my local system, the default login screen showed the below error message:
The page cannot be displayed
The page you are looking for is currently unavailable. The Web site might be experiencing technical difficulties, or you may need to adjust your browser settings.
--------------------------------------------------------------------------------
Please try the following:
If you typed the page address in the Address bar, make sure that it is spelled correctly.
If you are trying to reach a secure site, make sure your Security settings can support it.
Click the Back button to try another link.

DNS Fail

I changed the local link with my local IP address. It started working fine.
Like from -http://localaddress:7001/analytics/saw.dll?bieehome&startPage=1
to http://my/ IP address:7001/analytics/saw.dll?bieehome&startPage=1

Friday, 4 May 2012

Column Formula Formatting

In one of our requirement we had to show two values separated by different background colours in a single cell. Example shown below:






Put the below code :
'<span style="background-color:Red">Laptop</span>'
||'<span style="background-color:Green">Desktop</span>'
in the column formula and then enable HTML in the Data Format tab of the column.