CONNECTED SAP Dashboard as HTML5 – Step-By-Step Info

As promised on the last post, you can find below a detailed account of how to get your connected HTML5 harvested SAP Dashboards (Xcelsius) files to work outside the SAP BI App.
I tried to strike a fine balance between keeping this to a simple set of instructions and giving enough info for troubleshooting and explanations.
At a very high level the process is as follow:
1. Harvest the HTML5 source files
2. Place them in a webapp
3. Obtain a BO token (as in any other connectivity scenario with BO)
4. Make a few small modifications to the HTML5 files to leverage the token and pass it through to the REST services being used to invoke the connections in the dashboard
So, let’s get started!
Step 0:
Copy the temp files while preview to mobile. I am not going to elaborate on this step, I assume by now you know how to find the dashboard html5 files


Step 1:
Paste the HTML5 source files from the temp directory in a webapp. In my example, I created a webapp on the BO server tomcat called dashboardunwiredrepeat. This webapp has all the jars needed in the WEB-INF directory to use the BO SDK to authenticate a user and obtain a token. To make it easy to deploy multiple dashboards in a single apps, you can make subfolders for each dashboard as dash1, and dash2 in this example


Step 2:
Prepare to use the BO token. In my example, I used a .jsp file to authenticate with a hard coded username and pwd against the BO system, obtain a token and store it in the tomcat session. To leverage this token, I simply renamed dashboard.html to dashboard.jsp, making it possible to include my .jsp file inside the main dashboard page to use the token. Of course, there are many different ways to accomplish this, and pass the token to the dashboard.html file without converting it to a .jsp with server side code


Step 3:
Get access to the BO token. As I explained in the prior step, my inc.jsp file contains SDK code to obtain a token and stire it in the session. I will include it in the dashboard.jsp file so I can easily access the token. Open dashboard.jsp with a text editor and make the following changes:
a. Paste the following line as the first line in the file:

<%@ include file="../inc.jsp" %>

b. Paste the following code immediately after the line

"<script type="text/javascript">"

in the

<body>

Section of the file (rename the url to be your server url as needed):

/*****************************************************

Begin Custom code added to Dashboards generated code

*****************************************************/

var mySession = '';

$(window).load(function() {

$.ajax({

type: "POST",

url: "http://[host:port]/dswsbobje/services/Session",

data: "{\"loginWithToken\":{\"@xmlns\":{\"$\":\"http://session.dsws.businessobjects.com/2007/06/01\"},\"loginToken\":{\"$\":\"<%= session.getAttribute("BOTOKEN")%>\"},\"locale\":{\"$\":\"\"},\"timeZone\":{\"$\":\"\"}}}",

contentType: "application/json; charset=utf-8",

dataType: "json",

beforeSend: function (xhr) {

xhr.setRequestHeader('SOAPAction', 'http://session.dsws.businessobjects.com/2007/06/01/loginWithToken');

},

success: function(msg) {

mySession = msg['ns:loginWithTokenResponse']['ns:SessionInfo']['@SerializedSession'];

},

error: function (errormessage) {

$('#msgid').html("oops got an error in first service call!");

alert('error');

}

, async: false

});

/***************************************************

End Custom code added to Dashboards generated code

****************************************************/

Save and close the dashboard.jsp file

Step 4:

Locate the file file_1.js and open it in a text editor. Copy the file contents and paste it in the site http://jsbeautifier.org/click the beatify button and paste the formatted text back into the file_1.js file.  Find the line

“this._ceSerializedSession = this._connectionAPI.getInitParameter(l.PARAM_CE_SERIALIZED_SESSION);”

and comment it out by typing two backslashes in front of it like so:

// this._ceSerializedSession = this._connectionAPI.getInitParameter(l.PARAM_CE_SERIALIZED_SESSION);

Then paste the following line under the commented out line:

this._ceSerializedSession = mySession;

Save the file and close it

Step 5:

Locate the file file_2.js (next to file_1.js), open it with a text editor, and format it as described in step 6 using the http://jsbeautifier.org/ web site. Find the following block of code:

} else {

u.soapAction = p.RUN_QUERY;

u.request = this._generateRunQuery();

u.response.responseRoot("x:runQueryResult")

comment out the three lines like so

} else {

//            u.soapAction = p.RUN_QUERY;

//            u.request = this._generateRunQuery();

//            u.response.responseRoot("x:runQueryResult")

And paste the following three lines beneath the lines you just commented out:

u.soapAction = p.RUN_QUERY_SPEC;

u.request = this._generateRunQuerySpec();

u.response.responseRoot("x:runQueryDesignTimeResult")

 

That’s it! Take your connected dashboard for a spin at http://yourserver:yourport/yourwebapp/yoursubdir(dash2inthisexample)/dashboard.jsp

How to publish CONNECTED SAP Dashboard (Xcelsius) as HTML5 OUTSIDE the mobile app!

This is a fully functioning connected HTML5 version of an SAP dashboard that connects to the eFashion universe on State change and refreshes the data. Yes. You are not reading this wrong. No plugins used, no third party tools or tricks, just SAP dashboard XLF file. Read on to learn more…

Ever since I read Joseph Warbington SCN post about finding SAP Dashboard html5 source files when previewing a dashboard for Mobile, I’ve been intrigued with the possibilities this opened up.

So, during the SAPPHIRE conference, I managed to find an SAP employee on the show floor who was a member of the Dashboard product team. “Can you please tell me when will SAP make the option to export dashboards outside the mobile App available?” I asked. “Well, never… there is no such plan and dashboard relies on the platform for certain things, so we will not make such functionality available…”. Hmmm… Really. Well, this conversation left me a bit disappointed (and by the way, I have no idea if this is the official SAP stance, this was just one side conversation, with one person who works at SAP, who may or may not know the entire product road map). So, after I got home, I decided to try and replicate the full dashboard functionality in HTML5 outside the BI app.

As Joseph Warbington describes, harvesting the HTML5 source files is relatively simple, and it all works just fine, except for one important piece. Connections… Since SP5, we can use the Query Browser to embed connectivity in the mobile dashboards, and quite frankly, without connectivity, I don’t really see much enterprise use in the dashboard. And of course, when trying to get the connections to “just work” after copying the HTML5 files from the Temp directory does not work.

So, armed with chrome network debugger, fiddler, a good understanding of the various BO SDKs (the web services and enterprise ones in particular) and with the invaluable help of my colleague, Yevgeniy (Eugene) Tsvetov, we set out to understand how Dashboard invokes connections and what we would need to get the connections to work outside the BI APP. The result is displayed at the top of this post.

The files generated by SAP dashboard already contain all the scaffolding needed for the connections to work, the only thing that is really missing is the enterprise session. So, by adding a few lines of JS to the files generated, we can pass the session using the enterprise and web services SDK. And REST assured, it all works!

This opens up the possibility for Dashboard designers to post their fully connected awesome designs not just to the BI App, but also to any web site, without needing to use flash!!! Enjoy…

Crystal Reports on SAP Mobile BI

It seems like every month SAP is unleashing new functionality for its Mobile BI app. Explorer, Web Intelligence and recently Dashboards have all made their way into the BI app and seem to work better, look nicer and perform faster then on the desktop! The mobile versions are not only slick and easy to use, they are also very easy to deploy to. For webi, all it takes to turn the report to mobile ready is assignment to a category (as is the case for Dashboards and Crystal), Explorer is there by default, and Dashboard can be saved as Mobile when exported to the repository. It’s that simple. Well, almost… While the product does allow developers to deploy content to the BI app very easily, the challenges of the design are still there, with a twist. Data issues, business logic complexities, real estate constraints, functionality gaps, all of the same challenges that make BI content development difficult for any device are applicable, with the additional challenge of new constraints related to mobile device usage and functionality that is “ramping up”. And while Webi, Explorer and Dashboards are “sexy”, dashing and elegant tools, I set out to try the capabilities of good old Crystal Reports on the BI App, and as always when it comes to Crystal, I was not disappointed!

While Crystal on the iPad lacks some of the Explorer and Webi “swooshiness” and feels a bit “boxy”, it certainly provides much more flexibility in design, navigation and layout capabilities. And since images can be used to enhance its look and feel, Crystal can be made to look as modern as any. Unlike in Webi on the mobile BI app where the report design is limited to simplistic blocks that get converted automagically to the stunning iPad design, Crystal reports will render EXACTLY the way you design them on the desktop. So you can layout the screen any which way you like, which can be very important for some design situations. Crystal unlimited data connectivity also makes it a great choice for directly connecting to any data source with ease. So your crystal report on the iPad will connect to anything you need to, from Universes to any RDBMS, web service, and beyond. The group tree functionality is also enables on the iPad and provides slick and easy way to navigate large hierarchies on the iPad, prompts, work as well and drill downs are all there in their interactive glory. You can paginate using the page number icons, or simply swipe left to move to the next page. Nice.

The image I posted is from a Crystal Report I created with sales data and hierarchy, and I hope it provides a good example of what Crystal actually looks like on the iPad.

So, all in all, Crystal can be an important companion for your mobile BI content deployment, and after more than two decades of reign over the enterprise reporting realm can still help address use cases and reporting scenarios that other more modern tools cannot.

BI Happiness with html5 charts animation

Published by Ron Keler in Data visualization, HTML5 on April 16th, 2013 | No Comments »

The other day, my colleague Rob Blackburn wrote a really cool and elegant function to animate html5 charts for our dashboards. It was so cool, that it even made my scatter charts smile…

How I loaded my blog into HANA (and what I learned about it once it was there…)

Published by Ron Keler in HANA on March 18th, 2013 | No Comments »

Unstructured data analysis is one of the most interesting aspects of “big data”. It’s certainly impressive to be able to process massive amounts of structured data in no time, but analyzing unstructured data opens completely new possibilities, that can lead to the creation of whole new disciplines or industries. To test out HANA text analysis capabilities, I thought I would try to load my blog into a column table, and see what it can do.
Leveraging my company AWS HANA instance, I started out by making a simple single column table. The important thing to note here is that for text analytics to work, the data type to be used has to be NCLOB. BLOB for example, will not work.
So, in HANA studio, after connecting to the HANA instance and my schema, I executed:

--1. Create an empty table with NCLOB column to store blog content
create column table RONKELER.BLOG_TEXT (BLOG_CONTENT NCLOB);

The next step was a bit more interesting. How do I actually load my blog into the table…? Well. First, I had to get my blog out to a file. Since I use wordpress, that was as simple as selecting the Export option from the Tools menu of the administration section.

With my blog exported as an xml file, I set my sights on loading it into my table. Data Services would be my typical choice, as it’s fast, easy to use, and has great integration with HANA. However, to keep my options open, I looked for a programmatic solution that will allow more robust capabilities. And as it turns out, the solution was similar to loading a blob object into any other database. I ended up writing a small java program to load the file in.
To connect to HANA in java, I needed to find the ngdbc.jar library and add it to my project build path in Eclipse. The rest was pretty standard:

import java.io.*;
import java.sql.*;
public class HanaConn {
 public static void main(String args[]) {
  try {
   File f = new File("C:\\FOLDER\\FILE.xml");
   InputStream is = new FileInputStream(f);
   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
   java.sql.Connection conn = DriverManager.getConnection(
     "jdbc:odbc:imdbhdb", "SYSTEM", "PWD");
   conn.setAutoCommit(false);
   PreparedStatement stmt = conn
     .prepareStatement("INSERT INTO RONKELER.BLOG_TEXT VALUES(?)");
   stmt.setBinaryStream(1, is, (int) f.length());
   stmt.executeUpdate();
   conn.commit();
   is.close();
   System.out.println("Done inserting!");
   stmt.close();
   conn.close();
  } catch (Exception e) {
   System.out.println("Exception occured: " + e.getMessage());
   e.printStackTrace();
  }
 }
}

So, step 2

--2. Run java program to load blog content

Next, I modified my table to add a primary key. Using the text analytics requires the analyzed table have a PK:

--3. Add column to be used as PK
alter table RONKELER.BLOG_TEXT add (k int);
--4. Populate PK value
update RONKELER.BLOG_TEXT set k = 1;
--5. Add PK constraint
alter table RONKELER.BLOG_TEXT add constraint pkconst primary key (k);

So far, things have been pretty standard. The cool part was turning on the text analytics. Using one simple SQL command, HANA processed the content of my text column, and parsed it out in nano seconds!

--6. Create fulltext index on blog content
Create FullText Index "BLOG_CONTENT_IDX" On RONKELER.BLOG_TEXT(BLOG_CONTENT)
TEXT ANALYSIS ON
CONFIGURATION 'LINGANALYSIS_STEMS';

This query generated a table called $TA_BLOG_CONTENT_IDX. This table included a row for each word in my blog, allowing me to then run some queries to perform analysis on the content of my blog..:

-- Analysis...
--1. How many words/unique words?
select count(*) from RONKELER."$TA_BLOG_CONTENT_IDX"; --342174 words! Wow, who knew i wrote so much...
select count(distinct upper(ta_token)) from RONKELER."$TA_BLOG_CONTENT_IDX"; --7781 unique words... Maybe i need to read more to expand my vocabulary..
--Longest word? How many times used?
select max(length(ta_token)),
(select ta_token from RONKELER."$TA_BLOG_CONTENT_IDX" where length(ta_token) = (select max(length(ta_token))from RONKELER."$TA_BLOG_CONTENT_IDX"))
from RONKELER."$TA_BLOG_CONTENT_IDX"; --54;VbZDUzY2M2ZDQtYzNmMC00OTJjLTlhMDUtNDU3MGMyY2ZkOWZm&amp well, not really a word, but you get the idea
--Most used words
select upper(ta_token),
count(upper(ta_token))
from "RONKELER"."$TA_BLOG_CONTENT_IDX"
where length(upper(ta_token)) > 3
group by upper(ta_token)
order by count(upper(ta_token)) desc; -- Well, need to do some more with this, but Xcelsius and Webi were pretty high up on the list

Of course, this is a tiny example, but the ability to store and quick and easily parse text can be an important feature in any HANA implementation. From social media content to corporate documents, this is a game changer!

Use SAP BI Publications to solve complex content delivery processes

One of the most important, and less understood or used, featured of the SAP BI platform (BusinessObjects) is the Publication feature. Publications are essentially a “mass mailing” tool, that allows BI content developers to develop highly sophisticated, personalized and robust delivery mechanism of content directly to users email boxes. In particular, the dynamic recipient list flavor of publications, allow BI users to deliver reporting content to email lists, regardless of whether they are users of the BI platform. This content can be personalized, and delivered based on data driven rules to each user. What this spells is a very powerful, simple and easy to use, mechanism to address many business process issues related to information delivery. Let me describe a case in point:

A professional services firm charges for hours worked by consultants, therefor, timely time entry of consultants’ billable hours is critical to the business operation. To assure consultants do not miss the time entry deadline each week, we can use a publication. How does it work?

The time entry system has a table of users, and their email addresses, as well as table for collecting time entry data with hours entered by week and day.

Two webi reports have been setup to support the publication: the first report is used to generate the dynamic recipient list. The report contains the three required columns for such a list (ID, Name, Email) and has a filter that only retrieves users who are missing time entry for the prior week.

A second report, which will be used as the actual content to send to the users, was also created with the users email address (will be used to personalize the publication and “link” the distribution list to the report), and some text asking the user to enter their time for the missing week.

With the two reports ready to go, all that is left, is the publication setup. The following screen shots describe the publication creation setup. In this case, the mHTML format was used to deliver the report content right in the email body for the users. Enjoy!

 

 

 

 

Infographic style crystal report

In a continued effort to demonstrate the capabilities of the various BusinessObjects reporting tools as adequate in the user interface area, i created this info graphic style crystal report. This report is modeled after my colleague’s Josh Tapley original InfoGraphic Style dashboard, and follows my example of the InfoGraphic style Webi. All this is simply a demonstration of the visual capabilities of these tools, and a statement of BI Happiness that declares that delivering data to users DOES NOT have to be ugly, boring and difficult. To be successful, users must WANT to use the reports, with no users adoption, any BI project is doomed. In this example, a crystal report was used, leveraging images and formatting options, as well as the RAS SDK with a custom viewer to embed the reports in a seamless fashion in a web page. Enjoy!

H + The Digital Series – animated interactive timeline chart

A colleague at work recently told me about the web series H +. It sounded interesting, so i went to check it out, and was instantly hooked! For me, this was a brand new genre, and one that fits the new connected world we live in perfectly. Each episode in the series is 3-6 minutes long, so you can watch the episodes in all kinds of time configurations. The story is thrilling, the production is superb, and the whole experience is riveting. One of the interesting things about the series is the way the plot unfolds, where each episodes jets the viewer into a different time slot, related to “the event” (i really don’t want to spoil anything…). So in an effort to try and put the pieces together, i created an animated line chart that plots the episodes timeline. Click on the image below to view the animation and mouse over the data points to get episodes info. Enjoy..

 

Recalls dashboard

The Consumer Product Safety Commission (http://www.cpsc.gov/) collects and publishes information about product recalls. The department made its database of recalls information available to the public as a web service, which means we can have fun with this data… Leveraging our html5 dashboarding framework, I created a dashboard that consumes the web service (allows user to select start year for the recalls data) and aggregates the number of recalls based on user selected attributes (like country or manufacturer). The chart display shows categories that had 4 or more recalls in the selected time frame, the Raw Data view dumps the entire data set on the screen. This is interesting stuff.. Enjoy!

Play the pie chart Dreidel

Published by Ron Keler in BI At Large, Xcelsius on December 6th, 2012 | No Comments »

This Saturday is the first night of Chanukah, the Jewish “festival of lights” holiday. One of the games kids play during this holiday is called Dreidel. The Dreidel is essentially a top that has four Hebrew letters marked on four sides. To play the game, kids spin the Dreidel and while it spins, they pick a letter from the four possible options. When the Dreidel stops, whoever picked the letter the Dreidel landed on, wins. In the spirit of the holiday, and since I have been working with Xcelsius SP5 and some of its new mobile features, I created a simple pie chart Dreidel game… Enjoy and happy holidays!

© BI HAPPY
CyberChimps