Pentaho Tools :

Pentaho C-Tools(CDE,CDF,CDA),Pentaho CE & EE Server,OLAP-Cubes,Analysis using Pivot4J, Saiku Analytics, Saiku Reporting, Ad-hoc Reporting using Interactive Reporting Tool,Dashboards,Reports using PRD, PDD,Data Integration using Kettle ETL,Data Mining usign WEKA,Integration of Servers with Databases,Mobile/iPad compatible Dashboards using Bootstrap Css,Drilldown dashboards,Interactive Dashboards

Monday, 5 May 2014

Embedding BI - Call username & password and dashboard parameters from CDE dashobard URL using iframe tags

A small workout on Embedding BI using Pentaho CDE dashboards..

Version Specific :
BA server : 5.1.0 stable CE
C-Tools : CDE,CDA,CDF of latest TRUNK version (after 14.x)

Steps :
1) Open your dashboard in new window to generate the URL
2) For instance the URL is some thing similar as shown below

URL when you open in new window

URL after adding BA Server Username and Password as parameters

URL after adding Dashboard parameters along with BA server credentials as parameters


Here you need to take custom parameters instead of Simple parameters.
For example :
param1_deptId is the custom parameter and in the java script area you need to write below code
function sendParam(){
       return  Dashboards.getQueryParameter("param1_deptId");

In another case of passing parameter like date type

param2_Date is the custom parameter and in the java script area you need to write below code
function sendParam(){
       return  Dashboards.getQueryParameter("param2_Date");

You need to add these parameters to your chart and query
For chart : 
Parameters : param1_deptId,param2_Date
Listners : param1_deptId,param2_Date
For query :
Parameters: param1_deptId (String Type) 
                     param2_Date(String Type)   

Sample Query in Oracle SQL where clause for the above scenario :
to_char(column2_date(+),'mm/dd/yyyy') =${param2_Date}

note that in the above clause (+) indicates in right outer join Oracle 10g

NOTE: You can pass multiple general parameters by adding &paramName=value in the URL

3) Copy paste the URL in the web browser and test.. You will find the dashboard output directly.

Imp Note : 
URL passing mechanism in BA server 5 is slightly differ from previous versions.
As suggested in jira for pentaho 5 server, you need to modify applicationContext-spring-security.xml under pentaho-solutions/system

Change 1 : at line 22 

Original Code :
Replace the Original Code with :


Change 2 : at line 23  
Original Code :

Replace the Original Code with :


Once you done the changes , you need to restart the BA server.

Using iframetags :

<iframe src="DashboardURLwithParameters"></iframe>

References : 




Thank you for reading this article and if you have any queries and/or suggestions drop your comments....