Showing posts with label BI DASHBOARDS. Show all posts
Showing posts with label BI DASHBOARDS. Show all posts

Friday, June 12, 2020

Custom OBIEE Home Page

let us see how following OBIEE custom home page can be created for end users one-click access.




Here is the underlying code.

Header - Welcome learning catalog.
Import banner.png to shared/images catalog folder.
Now create a dashboard.
Add a Text component and place following code.

<img src="/analytics/saw.dll?downloadFile&Path=%2fshared%2fimages%2fbanner.png" width=1200 height=150/>


Section – One Click Dashboards

Add another Text object show some section with image
<html>
<head>
<style>
.p1 {
  text-shadow: .3px .3x .6px #B9C53A;
    font-size: 20px;
    color: #FFFFF;
}
</style>
</head>
<BODY>
    <table cellspacing="0" cellpadding="3%" width = 450>
        <TR>
            <TD align="left" >
               <img  alt="" src="saw.dll?downloadFile&amp;Path=%2fshared%2fimages%2fSection1.png" width=80 border="0" /> 
            </TD>
            <TD align="left" valign="middle" halign="left">
              <P class="p1" > One Click – Dashboards </font> </br> </P>
            </TD>        
        </TR>  
    </table> 
</body>
</html>

Report – Here you go

Create OBIEE report with Static Text view to point dashboard links

<html>
<head>
<style>
.card1 {
    box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
    transition: 0.3s;
    width: 270px;
background-color: #f5f5f5;
text-align: left;
border-radius: 25px;
  border: 2px solid #f5f5f5;
}
.card1:hover {
     box-shadow:  0px 3px 4px 0 rgba(255,153,51,1), 0 10px 10px 0 #B9C53A, 2px 0px 10px 4px #245688;
background-color: #f5f5f5;
}
.container {
    padding: 2px 16px;
}
.ul1 {  padding-left: 15px; color: #53565a;
}
</style>
</head>
<body>
<div class="card1">
  <div class="container">
  <h3>Here you go<hr></h3>
<ul class="ul1">
<li>
<p> 
<a name="SectionElements" href="javascript:void()" actionxml="<saw:action xmlns:saw=&quot;com.siebel.analytics.web/report/v1.1&quot; 
xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;><saw:parameters allowExtraParameters=&quot;true&quot;>
<saw:parameter name=&quot;__navigateToBIContent__&quot; type=&quot;string&quot; mandatory=&quot;true&quot; removable=&quot;true&quot; 
order=&quot;999&quot; multiValues=&quot;false&quot;><saw:prompt>__navigateToBIContent__</saw:prompt><saw:description/></saw:parameter>
</saw:parameters><saw:assignments><saw:assign name=&quot;__navigateToBIContent__&quot; fixed=&quot;true&quot; hidden=&quot;true&quot; 
parentFixed=&quot;false&quot; parentHidden=&quot;false&quot; xsi:type=&quot;saw:stringAssign&quot;>
<saw:value>/shared/_portal/Dashboard 1</saw:value></saw:assign></saw:assignments>
<saw:implementation xsi:type=&quot;saw:ScriptActionType&quot; executeOnClient=&quot;true&quot;>
<saw:functionName>__navigateToBIContent__</saw:functionName><saw:scriptLanguage>JScript</saw:scriptLanguage><saw:scriptPath/>
</saw:implementation><saw:clientImplementation><saw:customisation invokeConfirmation=&quot;false&quot; openNewWindow=&quot;false&quot;/>
</saw:clientImplementation></saw:action>" parammapping="" dashstyle="Alta" inframeset="false" menuoptions="" onclick="obidash.executeAction(this); 
return false;"><font color="#53565a";>Dashboard 1</a><font>
</p>
</li>
<li>
<p> 
<a name="SectionElements" href="javascript:void()" actionxml="<saw:action xmlns:saw=&quot;com.siebel.analytics.web/report/v1.1&quot; 
xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;><saw:parameters allowExtraParameters=&quot;true&quot;>
<saw:parameter name=&quot;__navigateToBIContent__&quot; type=&quot;string&quot; mandatory=&quot;true&quot; removable=&quot;true&quot; 
order=&quot;999&quot; multiValues=&quot;false&quot;><saw:prompt>__navigateToBIContent__</saw:prompt><saw:description/></saw:parameter>
</saw:parameters><saw:assignments><saw:assign name=&quot;__navigateToBIContent__&quot; fixed=&quot;true&quot; hidden=&quot;true&quot; 
parentFixed=&quot;false&quot; parentHidden=&quot;false&quot; xsi:type=&quot;saw:stringAssign&quot;>
<saw:value>/shared/_portal/Dashboard 2</saw:value></saw:assign></saw:assignments>
<saw:implementation xsi:type=&quot;saw:ScriptActionType&quot; executeOnClient=&quot;true&quot;>
<saw:functionName>__navigateToBIContent__</saw:functionName><saw:scriptLanguage>JScript</saw:scriptLanguage><saw:scriptPath/>
</saw:implementation><saw:clientImplementation><saw:customisation invokeConfirmation=&quot;false&quot; openNewWindow=&quot;false&quot;/>
</saw:clientImplementation></saw:action>" parammapping="" dashstyle="Alta" inframeset="false" menuoptions="" onclick="obidash.executeAction(this); 
return false;"><font color="#53565a";>Dashboard 2</a><font>
</p>
</li> </ul>
   </div>
</div>
</body>
</html>





Wednesday, February 22, 2017

OBIEE 12c Dashboard page issue

Noticed a strange behavior in the OBIEE 12c dashboards that whenever a dashboard page opened it is navigating to some other page rather than clicked page. Sometimes if you click on a page then other pages are disappearing and only clicked page is opening on browser.

Issue: There are hidden dashboard pages at starting position as shown in following screenshot and those are causing this issue. If you un hide them it works fine .







































Way around:
Delete the hidden pages
or Un Hide pages
or Move all the hidden pages to last position as shown following and save.






































Now it should work as expected without any weird behavior.

Wednesday, November 9, 2016

Writeback with dropdown feature in OBIEE Report

In this blog we will see how to enable Writeback in OBIEE and one example like where users will be given option to choose values from dropdown to select any one and update in backend rather than typing in freeform text field in the OBIEE report. We will use Jquery to achieve it.
Below are the high level steps to enable write back in OBIEE.
·         File level configurations
·         RPD changes
·         Report changes

File level configurations

Step 1: Edit instanceconfig.xml
Here is the path to find instanceconfig.xml file
<Middleware>/instances/instance1/config/OracleBIPresentationServicesComponent/coreapplication_obipsn
And add below line under <DSN>
<LightWriteBack >true</LightWriteBack >
Step 2. Create WriteBack template  
We need to provide a template to the BI Server so that it will handle the writeback operation based on logic provided in template.
And place this template in below location in the Middleware server.
<Middleware>/instances/instance1/bifoundation/OracleBIPresentationServicesComponent/coreapplication_obips1/analyticsRes/customMessages

 Sample template code

<?xml version="1.0" encoding="utf-8" ?>
<WebMessageTables xmlns:sawm="com.siebel.analytics.web/message/v1">
<WebMessageTable lang="en-us" system="WriteBack" table="Messages">
   <WebMessage name="Update_Comments">
     <XML>
      <writeBack connectionPool="Oracle Data Warehouse Connection Pool">
          <insert> </insert>
          <update>UPDATE EMPLOYEES set COMMENTS='@2' WHERE EMP_NAME='@1'</update>
<!-- Identify the columns that are to be referenced. We can use the column position like @1 for first column, or by column id as you see them in the XML definition/Table view. -->
        </writeBack>
      </XML>
    </WebMessage>
</WebMessageTable>
</WebMessageTables>


And name it like anything let say WriteBackTemplate.xml and copy to customMessages folder in the server.  

RPD Changes

Step 3: Enable Write Back in the RPD logical column
Navigate to to BMM table and expand column which you want to use for writeback
And enable the Writable checkbox under general table of logical column.










 
 
 
Step 4: Set Read/Write permission to Writable column
Navigate to Subject Area-> Presentation Table-> Writeable column (here column is comments in our example)

Double click on Permissions and select Read/Write for the application role for which you like to enable writeback feature










 






 






 
 
Here for BIAdministrator Read/Write permission enabled on this writable column.So that any user with this application role can writeback data from obiee report.

Step 5. Allow “Execute Direct Database Request” to database.
We need to set the permission to application role so that user with role should be able to contact database for insert/update data in backend.

Navigate Manage > Identity > Application Roles > BIAdministrator > Permission>Query Limits tab
And select “Execute Direct Database Requests” to Allow for the Database where in which you writable table or column    .




















 





Step 6. Disable Cacheable option for physical table.
Navigate to Physical Table and uncheck Cacheable checkbox.

Step 7. Grant Writeback privilege to Apllication Role or Users
Login Analytics and navigate to Administrator->Manage Privileges
And search for Write Back property and “Write Back to Database”
Grant access to BIAdministrator role 


Report Changes


Step 8. Create a OBIEE report
Create a report on this subject area and pull employee name and comments and another dummy column (Select Comment)

Note: Here Comments is the real write back column.whatever the value we select from the dropdown will be updated into this writeback column.
 


 






 


Here we will use the JQuery to display drop-down on "Select Comment" column
 
Edit formula and add below code.

'<select id="user_comment" onchange=obipswb.Grid.Change(event)>
<option value="No Comment">Select Comment</option>
<option value="Good">Good</option>
<option value="Bad">Bad</option>
</select>'
 













Make sure you selected checkbox for “Contains HTML markup”.

On clicking OK then it thrown error as 






We can ignore this error and proceed further.

Next override default data format to HTML.




Now enable Writeback to the Comments column










 


Create Table view and place this drop down column at second position in view (since we used @2 to update the value in the backend table).
Open table properties and provide WebMessage name (This should be taken from your WriteBackTemplate.xml).



Check the report to test WriteBack feature.



















Once you select any value from dropdown  then Apply button will be enabled and record can be updated on clicking apply. Note that drop-down column will not be updated with value you selceted and you can only see this value in the next column "Comments" which is write back column.ON clicking apply report will be refreshed and new value will be displayed on report.

Monday, May 11, 2015

How to find number of selected prompt values- OBIEE Dashboard prompts

In this post we will see how we can get the count of values selected in OBIEE dahboard prompt.
For instance , we have prompt where it will list out all the month names,now if you want to do the calculation based on number of selected months (like calculating avg sales based on number of months selected),then this logic will be most help full.

Lets assume we have a dashboard prompt which had list of values like JAN-15,FEB-15,MAR-15,APR-15,MAY-15 etc. 
if you select first 3 months in the prompt then OBIEE presentation variable passes the multiple selected values as comma separated string like JAN-15,FEB-15,MAR-15 as shown below.







Here 3 values selected an those 3 are separated by 2 commas .
So basic idea is finding number of comma(,)s occurrences in the input obiee prompt string and add 1 to it get total number of selected values.

Here is sample sql
select (length('JAN-15,FEB-15,MAR-15') - length(replace('JAN-15,FEB-15,MAR-15', ',','')))+1 from dual;

which is length(whole string)-length(whole string without commas)+1 will give the number of  values separated by comma.

Same logic can be implemented in OBIEE with below formula in answers.

CHAR_LENGTH('@{PeriodCount}') -CHAR_LENGTH(REPLACE('@{PeriodCount}', ',',''))+1

Here @{PeriodCount} is presentation variable which is assigned to Fiscal Period Prompt