Showing posts with label dashboard. Show all posts
Showing posts with label dashboard. Show all posts

Sunday, February 15, 2015

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
http://localhost:8085/pentaho/api/repos/:public:Explore:CDEExploring:Test:passParametersFromURL.wcdf/generatedContent

URL after adding BA Server Username and Password as parameters
http://localhost:8085/pentaho/api/repos/:public:Explore:CDEExploring:Test:passParametersFromURL.wcdf/generatedContent?userid=admin&password=password

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

http://localhost:8085/pentaho/api/repos/:public:Explore:CDEExploring:Test:passParametersFromURL.wcdf/generatedContent?userid=admin&password=password&param1_deptId=100&param2_Date=01/04/2014

Here you need to take custom parameters instead of Simple parameters.
i.e.,
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 :
where 
to_char(column1_deptId)=${param1_deptId}
AND
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 :
/api/**=securityContextHolderAwareRequestFilterForWS,httpSessionPentahoSessionContextIntegrationFilter,httpSessionContextIntegrationFilter,basicProcessingFilter,anonymousProcessingFilter,exceptionTranslationFilterForWS,filterInvocationInterceptorForWS
Replace the Original Code with :

/api/**=securityContextHolderAwareRequestFilterForWS,httpSessionPentahoSessionContextIntegrationFilter,httpSessionContextIntegrationFilter,requestParameterProcessingFilter,basicProcessingFilter,anonymousProcessingFilter,exceptionTranslationFilterForWS,filterInvocationInterceptorForWS

Change 2 : at line 23  
Original Code :

/plugin/**=securityContextHolderAwareRequestFilterForWS,httpSessionPentahoSessionContextIntegrationFilter,httpSessionContextIntegrationFilter,basicProcessingFilter,anonymousProcessingFilter,exceptionTranslationFilterForWS,filterInvocationInterceptorForWS
Replace the Original Code with :

 plugin/**=securityContextHolderAwareRequestFilterForWS,httpSessionPentahoSessionContextIntegrationFilter,httpSessionContextIntegrationFilter,requestParameterProcessingFilter,basicProcessingFilter,anonymousProcessingFilter,exceptionTranslationFilterForWS,filterInvocationInterceptorForWS

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

Using iframetags :

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

References : 
1) http://pedroalves-bi.blogspot.in/2013/08/embedded-analytics-in-pentaho-with.html

2) http://forums.pentaho.com/showthread.php?157329-Authentication-for-CDE-Dashboard

3)http://jira.pentaho.com/browse/BISERVER-10708

4)http://forums.pentaho.com/showthread.php?146325-How-to-link-a-CDE-dashboard-to-another-CDE-dashboard-by-passing-parameters&p=358865#post358865


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

Read more »

Saturday, February 14, 2015

New Mobile Product Sales Dashboard 3 Example in Pentaho CDE

Hi Guys,

Here is the new dashboard work out in Pentaho CDE.

High lights of the dashboard:  

1) Bar Chart with Trend Line
2) Stacked Bar chart with Trend lines + Line Chart.
3) Submit Button for input controls after selection.
4) Export charts to jpg images.
5) Reload with default inputs
6) Navigation (Home button) to Parent Dashboard(if we assume this as one of the child dashobards).
7) Mobile/iPad/laptop/Desktop comparability.



laptop View:






Mobile View:


Share a sample data of yours ...!!! Ill give you the meaning of it.

References :
1) http://www.webdetails.pt/ccc2/
2) http://www.webdetails.pt/ctools/ccc.html



Thank you.
Sadakar
BI developer (Japser/Petnaho/Talend ETL).
Read more »

Thursday, February 12, 2015

Drill down from one dashboard to another dashboard in Pentaho CDE Simple Example Not included any parameters

Hi Guys,

This post will teach you how you can drill down from one dashboard to another dashboard in pentaho CDE. This workout has done by one of my colleagues who is a fast learner.

You need to focus on 2 things in this post:
1) Connecting to JDBC datasource
2) Drill down from one dashboard to another dashboard.

NOTE :
Ill update you in next post about drill down from one dashboard to another dashboard using custom parameters concept.(Next work out).

Versions & Tools used for this post:
Pentaho C-Tools(CDE,CDA,CDF) 13.09 stable.
PostgreSQL DB - (foodmart database - which is one of  jasperserver default databases)
Pentaho BA server 4.8 stable.

SOURCE CODE OF THE EXAMPLE
Download the example using below link
https://drive.google.com/file/d/0BymV_QP4TGBEZ0p1cnpydDJGeDQ/edit?usp=sharing

Deployment procedure:
1) Down load the .rar file from the link(File-Download in the google drive)
2) Unzip it and place it in "pentaho-solutions" folder.
3) Refresh or clear the cache of the pentaho browser(find upper left - Browser)
4) If you are unable to find the folder name , you need to create an index.xml file (Eg: you can find it inside any folder. copy and paste it inside your working folder and change the name of it).
5) No need to restart the pentaho server.
NOTE: Edit data base connections as per your requirement also you may need to change the query if you use any other database than foodmart

Dashboard 1:
1) Layout section
* Design your lay out for dashboard1
2) Components section
* You will be placing 1 bar chart where you will click on bars for drilling down to another dashboard.
We will come back to this section again after designing Dashboard 1 and Dashboard 2
3) Data Sources section
* Click on Data source Icon on right top conrner.
* From the left .. click on SQL queries -> Click on sql over sqljdbc
* Give the name and all the properties as shown in below image.

NOTE:
PostgreSQL server default details :
Driver: org.postgresql.Driver
UserName : postgres
Password : postgres
URL:  jdbc:postgresql://localhost:6062/foodmart where 6062 is the port number which I used for postgres and foodmart is the database.
Note that default port number for postgresSQL is 5432 .

* Write a query which will suits for bars in the chart
* For eg:
SELECT
    c.country,
    c.state_province ,
    c.city,
    SUM(sf.store_sales)

FROM
    customer c,
    sales_fact_1997 sf
WHERE  c.customer_id=sf.customer_id
GROUP BY
    c.country,
    c.state_province,
    c.city

ORDER BY
c.country,c.state_province,c.city



* See the preview of the dashboard
* Out put will looks like below.

Dashboard 2 :
* Repeat the same steps as followed in Dashboard 1
* Take any component to display on the second dashboard.
* I have taken table component in this example and  the output will looks like below mentioned image.
*


We have done with 2 dashboards individually.
Now, Its the time for us to some trick on Dashboard 1 so that when we click on Dashboard 1 , it will have to take you to Dashboard2

Steps:
1) Lets go back to Dashboard 1
2) Go to the Chart component and in the properties give clickable as True
3) In the clickAction you need to give the URL of second dashboard in java script.
Eg:
function q(s,c,v)
{

window.location = http://localhost:8085/pentaho/content/pentaho-cdf-dd/Render?solution=CDE-+Exploring&path=%2FDevelopement%2FDashboard+Drill+down&file=drill_down_to_table.wcdf;

}


Thats it you have done with drill down. Save the dashboard 1 and see the preview and then click on any bar appearing , you will navigate to the 2nd dashboard.

NOTE :
This post is only giving the idea of how to drill down from one dash board to another dashboard.
This post doesnt work with any parameters. The use custom parameter with drill down from 1 dashboard to another dashboard will come in next post from my end.


URL generating problem / Path problem for Second Dashboard

How to generate the URL for 2nd dashboard ( not only for this but also works for every dashboard).?

* Right click on 2nd Dashboard and click on "Open In New Tab" the with the URL the 2nd dashboard will open in fresh tab.
* Copy that URL and paste in drill down function.
* For eg : Just reference : Find the images below
 





References :
1) http://forums.pentaho.com/showthread.php?152634-Drill-down-from-bar-chart-to-another-dashboard

2) http://forums.pentaho.com/showthread.php?82999-Drill-Down-in-DashBoards

Sadakar
("Learning never exhausts the mind")




Read more »