Quantcast
Channel: SCN : Document List - SAP BusinessObjects Design Studio
Viewing all 575 articles
Browse latest View live

Some extra Performancy knowhows

$
0
0

Some lessons learned I wanted to share with you...

 

Design Studio 1.3

Sap Hana 1.0 SP7

 

  • Adding the same Datasouce or copying the first one makes no difference.
  • Both scenarios  have the same runtime

 

Initialsetupquery(Column:Measure,Rows:Dimension)

DS_1.loaddatasource();

DS_1.setFilter
  (Dimension,Value);


Measure=DS_1.getDataAsString("Ordered", {});

 

 

Initialsetupquery:(Column:Measure,Rows:/)

DS_1.loaddatasource();


DS_1.setFilter (Dimension,Value);


Measure=DS_1.getDataAsString("Ordered", {});


DS_1.MoveDimensionToRows(Dimension);



DS_1.setFilterExt("Year",var_end);



If (var_end != ””){


DS_1.setFilterExt("Year",var_end);


}

 

 

  • Make use of the Global Script Variables, set the value for the GSV once and reuse them

var_end = Convert.subString(APPLICATION.getInfo().dateNowInternalFormat, 0,4);

DS_1.setFilterExt("Year",var_end);

TILE_1_SUBTITLE.setText(var_end);

 

  • Get Data once and filter in later stages.

var var_range = var_start + " - " + var_prev;

DS_6.loadDataSource();

 

Get Data from DS_6 over Multiple years

 

DS_6.setFilterExt(("Year", var_range);

DS_6.setFilterExt("Vendor", var_vendor);

DS_6.setFilterExt("VendorName",var_name);

DS_6.setFilterExt("VATRegistration",var_vat);

 

Filter DS_6 in a later stage for one year

g_vim=(DS_6.getDataAsString("Counter", {"Year": var_prev}));

TILE_6_VALUE.setText(g_vim);

TILE_DETAILS_6_VALUE.setText(g_vim);

 

  • Set Dynamic variables on startup

var_end = Convert.subString(APPLICATION.getInfo().dateNowInternalFormat,0,4);

var_prev = Convert.floatToString((Convert.stringToFloat(var_end)) - 1);

var_prev = Convert.subString(var_prev,0,4);

var_start=Convert.subString(Convert.floatToString((Convert.stringToFloat(var_prev)) - 4),0,4);

var var_range = var_start + " - " + var_prev;

 

 

  • Merged variables does not work on hana when coping with different views.  Workaround =

        Global script varibale

             var_vendor string false false

        on startup

             var_vendor=DS_1.getVariableValueExt("HANA_VARIABLE_VENDOR");

             APPLICATION.doBackgroundProcessing();

        on background

             DS_3.setFilterExt("Vendor", var_vendor);

 


Design Studio SDK: CheckBox Group (with Image) Component

$
0
0

Purpose

today a checkbox group with image (as optional) visualization.

 

How does it looks like? (click to animate GIF)

chekcbox group, with corresponding image per entry.

20140925-185810_capture.gif

 

Styles
scn-pack-CheckBoxGroupthe group itself style
scn-pack-CheckBoxGroup-Layoutthe single entry layout style
scn-pack-CheckBoxGroup-Picturethe picture style
scn-pack-CheckBoxGroup-CheckBoxthe checkbox style
scn-pack-CheckBoxGroup-SelectedValuethe selected layout style (only active when images are available)


Available Properties

 

Property NameDescription
fallbackPicture

Url to the fallback picture (must be set if picture is selected)

withPicture

with picture flag

pictureSizepicture size, 16px or 32px as choice

 

Scripting Functions

 

ScriptsShort Description
void removeAllElements ()removes all elements

void addElement (String elementKey,

               String elementText,

               String imageUrl,

               boolean selected)

adds an element

void insertElement (String elementKey,

               String elementText,

               String imageUrl,

               boolean selected,

               int insertionIndex0based)

inserts element at index

void updateElement (String elementKey,

               String elementText,

               String imageUrl,

               boolean selected)

updates element at key
void deleteElement (String elementKey)deletes element
String getKeyAtIndex (int index)returns key at given index
org.scn.pack.KeyLabelArray getSelectedElementsArray ()returns an array of selected elements
void setSelectedKey (String key, boolean selected)sets element as selectd / unselected
void setSelectedKeys (String keys, String separator)sets many elements as selected (those which are not in the list are unselected)


Events

 

EventShort Description
onSelectionChangedEvent triggered when selection is changed

 

Example Application

An Application with example can be downloaded at the BIAPP Repository:

Releases

 

Source Code & Licensing

This component is for free use. It is under the Open Source Apache Version 2.0 License.

 

Important MaintenanceNotice (... as I am SAP Employee)

The component is NOT delivered under SAP maintenance license.

You cannot claim any Support on this component from SAP!


The components are created on "private" basis - you can use them as is. I can modify, correct or improve - but there is no obligation to do it. Of course I will try to correct bugs or improve the component as long I can.

 

Have Fun!

 

for other components see: Karol's SDK Components

 

Ps. only basic properties are attached, if some are missing - just make a comment.

LInk to SAPUI5: SAPUI5 SDK - Demo Kit

Cascading style sheets(CSS) in Design Studio

$
0
0

Applies to:

SAP BusinessObjects Design Studio 1.1 and SAP BusinessObjects Business Intelligence Platform (4.0 SP5 or higher and 4.1). For more information, visit theSAP BusinessObjects Design Studiohomepage.

 

Summary

 

This article describes how to use CSS style editor to modify styles of individual components as well as process of defining common style to set of components across different Analysis apps using CSS Class and custom CSS file. The content in this is intended for beginners in design studio space and developers for those who would wish to change the styling of their existing analysis apps created using design studio 1.0.


 

Author: Mallikarjuna Chary Narayandas


 

 

 

 

Created on:June 08, 2013

 

Author Bio

 

The author has worked on several SAP BusinessObjects projects and has experience on using all the SAPBusinessObjectsBusiness Intelligenceplatform tools. Author has experience on working with SAPBusinessObjectsmobile including designing and accessingBusinessObjectscontent (Webi Reports, Crystal Reports, Dashboards, Analysis and Information Spaces) through IPAD /IPhone/ Android.

 

Introduction

 

This article describes how to use CSS style editor to modify styles of individual components as well as process of defining common style to set of components across different Analysis apps using CSS Class and custom CSS file. The content in this is intended for beginners in design studio space and developers for those who would wish to change the styling of their existing analysis apps that were created using design studio 1.0.

 

CSS Styling Properties


 

Design Studio offers different properties related to CSS styles based on the level such as application level, component level etc. Following sections give the details of these properties and their usage.

 

Application:


 

Custom CSS is the property available in application properties for the design studio apps and this property lets developers choose any custom CSS file to be used for the styling of the analysis application or dashboard. Refer to below sections to read the steps to use this property.

 

Note:CSS style sheets work properly in design studio only if they are in applicable and appropriate format.

 

Component:


 

Custom Class andCSS Style are the properties available at component level within display properties and these properties let developers define the styling of components such as font size,  background etc., for each individual component that has these properties applicable. Custom Class can be assigned to a group of components at a time to perform quick styling by selecting them using Shift>Select. Refer to below sections to read the steps to use these properties.


 

Modify CSS styling of Analysis Application


 

Developers can now change the look and feel of analysis application and it’s components by changing the existing CSS Style of the components using CSS style editor or by defining standard CSS style across a set of components or for a set of applications using CSS class. Developers can define CSS classes in a custom CSS file with the required CSS styling and re-use it across numerous analysis apps designed using Designed studio


 

Steps to change CSS Style of Individual components using CSS Style Editor


 

    1. Select a component that you want to change the styling for such as Text or Panel component.
    2. Go to properties on right side and Click on CSS Style to open the CSS Style editor
    3. Type the code in below format to change the styling of text of the component.

 

Ex:  font-size: 18px; weight: bold; font-style: italic; color: blue;

CSS STyle Editor.jpg

Steps to change CSS Class of Multiple components using CSS Style Editor


 

    1. Use Shift>Select  to choose multiple similar components(Ex: Panels) that you want to update the CSS Class to ensure you get common styling for the set of panels selected.
    2. Go to properties on right side and Choose the CSS Class available.

 

          Ex: CSS Class “myPanel” from “Analysis_template.css” file.

 

     Steps to assign CSS file to Custom CSS property of applications


 

          Developer need to ensure that they have the CSS file in the root folder of the application by navigating to the Application folder using File>Open               Repository Folder option


 

    1. Select the “Application name” on the left side in the layout panel
    2. Go to properties on right side and click on Custom CSS option and select the CSS file from the listed files.

               

               CSS file Analysis Template.jpg

CSS methods for Scripting


Developers can use the methods getCSSClass and setCSSClass within the scripts to read the CSS Class or to assign CSS Class to different set of components respectively.


 

Limitations


 

One of the current limitations is that only CSS attributes (font size, color, weight, style and text decoration) are supported for Text and Panel components. There are many new features planned for future releases of design studio, so I can confidently say SAP would make Design Studio as first choice and best product for all analysis and dashboards requirements on BW and HANA sources.

References

 

SAP BusinessObjects Design Studio

Space: SAP BusinessObjects Design Studio | SCN

For more information, visit  SAP BusinessObjects Design Studio References

 

Disclaimer and Liability Notice

 

This document may discuss sample coding or other information that does not include SAP official interfaces and therefore is not supported by SAP. Changes made based on this information are not supported and can be overwritten during an upgrade.

SAP will not be held liable for any damages caused by using or misusing the information, code or methods suggested in this document and anyone using these methods does so at his/her own risk.

SAP offers no guarantees and assumes no responsibility or liability of any type with respect to the content of this technical article or code sample, including any liability resulting from incompatibility between the content within this document and the materials and services offered by SAP. You agree that you will not hold, or seek to hold, SAP responsible or liable with respect to the content of this document

Design Studio SDK: Collection Util Component

$
0
0

Purpose

Work with Collections with sorting feature. This is usefull when you have some arrays, which you want to put together and sort.

 

This component is created with collaboration with Michael Howles.

Thanks Michael for allowing the reuse of the sorting-code from your blog Design Studio SDK - Get Top/Bottom N rankings with a little less code, as response on my primitive blog How to get "Top X" our of resultset


Supports

Items with

  • key
  • label
  • value

-> See also available extensions in How to Use Extended Sdk Collection to handle "properties"

 

Functions

 

FunctionDescription

void setItems (

  /*keys*/ String keys,

  /*labels*/ String labels,

  /*values*/ String values,

  /*separator*/ optional String separator)

initialization with 3 arrays, ideally all 3 are equal, if not, the loop is on keys:

  • in case label array is shorter, empty label will be add
  • in case value array is shorter, 0 value will be add

 

Default Separator is comma ,

void addItem (

  /*key*/ String key,

  /*label*/ String label,

  /*value*/ String value)

you can add items one by one as well

String getKeys(

  /*separator*/ optional String separator)

keys separated by separator

 

Default Separator is comma ,

String getLabels(

  /*separator*/ optional String separator)

values separated by separator

 

 

Default Separator is comma ,

String getValues(

  /*separator*/ optional String separator)

values separated by separator

 

 

Default Separator is comma ,

void sortBy...()some sort methods (provided by Michael)
int getLength()length of current array

String getLabelByIndex(

  /* index */ int index)

getLabelByIndex

String getLabelByKey(

  /* index */ String key)

getLabelByKey

String getValueByIndexAsString(

  /* index */ int index)

getValueByIndexAsString

float getValueByIndex(

  /* index */ int index)

getValueByIndex

String getValueByKeyAsString(

  /* key */ String key)

getValueByKeyAsString

float getValueByKey(

  /* index */ String key)

getValueByKey

 

The Coolest Function

 

FunctionDescription

org.kalisz.karol.scn.pack.KeyLabelValueArray getAsKeyLabelValueArray (

  /**max members*/ optional int maxMembers)

returns the complete collection of keys, labels, values as JSON loopable object

 

maxMembers can restrict the length of the returned array

 

Example Application


20140915-234033_capture.gif


An Application with example can be downloaded at the BIAPP Repository:

Releases

 

Source Code & Licensing

This component is for free use. It is under the Open Source Apache Version 2.0 License.

 

Important MaintenanceNotice (... as I am SAP Employee)

The component is NOT delivered under SAP maintenance license.

You cannot claim any Support on this component from SAP!


The components are created on "private" basis - you can use them as is. I can modify, correct or improve - but there is no obligation to do it. Of course I will try to correct bugs or improve the component as long I can.

 

Have Fun!

 

for other components see: Karol's SDK Components

Design Studio SDK: Opening Window with POST (allows many parameters)

$
0
0

Update / 24.10.2014

Small corrections for the component, eg. opening the same window again is working, and there is a fallback option in case the window is already opened.


Purpose

Generic Drag & Drop Control for all use cases. I have styled it a bit, now it can be used.

 

This component is created as response to APPLICATION.openNewWindow when upper limit to URL length is hit

 

How does it looks like?

the URL boundaries (2048 characters or so) can be only overcome via POST method.

 

Available Properties

 

Property NameDescription
url

Url which should be opened

windowId

NEW (24.10.2014)

Id for the window (same id means that the window can be reused)

fallbackSencario

NEW (24.10.2014)

option to decide what to do in case the window is already open

 

Scripting Functions (preview)

 

ScriptsShort Description

void setWindowId (

  /**window id*/String windowId)

NEW (24.10.2014)
you can set window id to open more windows

void setUrl (

  /**url*/String url)

NEW (24.10.2014)

you can set the url per script

void triggerExecution ()

triggers the execution of opening the URL

void addParameter (

  /**name*/String name,

  /**value*/String value)

allows to add parameters to the URL via name / value pairs
void removeAllParameters ()removes all parameters

 

Example Implementation for this call:

 

OPENWINDOWPOST_1.removeAllParameters();
OPENWINDOWPOST_1.setUrl("http://localhost:55555/aad/web.do");
OPENWINDOWPOST_1.addParameter("APPLICATION", "SDK_OPENWINDOW_POST");
OPENWINDOWPOST_1.addParameter("designersessionid", "25d9c2721c084d8c98684721835379d8");
OPENWINDOWPOST_1.triggerExecution();

Comparison before and after


     Assumption:

     you want to call URL http://localhost:8080/web.do?P1=V1&P2=V2


     Technical View:

          URL: http://localhost:8080/web.do

          Param1: P1

          Value1: V1

          Param2: P2

          Value2: V2


     Your code before:

 

var url = "http://localhost:8080/web.do";
url = url + "?";
url = url + "P1" + "=" + "V1";
url = url + "P2" + "=" + "V2";
APPLICATION.openNewWindow(url);

     Your code after:


     1) in Properties View you have tto set the url property to "http://localhost:8080/web.do"


     2) in script you need to add all parameters:

 

 

OPENWINDOWPOST_1.removeAllParameters();
OPENWINDOWPOST_1.addParameter("P1", "V1");
OPENWINDOWPOST_1.addParameter("P2", "V2");
OPENWINDOWPOST_1.triggerExecution();


This code will create a "form" in browser and submit the content via POST.


Example Application

An Application with example can be downloaded at the BIAPP Repository:

Releases

 

Source Code & Licensing

This component is for free use. It is under the Open Source Apache Version 2.0 License.

 

Important MaintenanceNotice (... as I am SAP Employee)

The component is NOT delivered under SAP maintenance license.

You cannot claim any Support on this component from SAP!


The components are created on "private" basis - you can use them as is. I can modify, correct or improve - but there is no obligation to do it. Of course I will try to correct bugs or improve the component as long I can.

 

Have Fun!

 

for other components see: Karol's SDK Components

Compilation of links: Using Design Studio with SAP HANA

$
0
0

Hello Everyone,

 

here a compilation of links regarding the usage of Design Studio using SAP HANA as backend or platform:

 

General

DocumentAuthor
Using Design Studio with SAP HANA end to end-Part 2Victor Gabriel Saiz Castillo
Design Studio 1.3 on HANA PlatformPoovin Kumar V
My experience with SAP BO Design Studio on HANAMuralikrishnan E
Getting Started on SAP Design Studio powered by BW on HANA – Part 1ANIL BAVARAJU
Getting Started on SAP Design Studio 1.3 powered by BW on HANA – Part 2ANIL BAVARAJU
Sharing the Knowledge - SAP TechEd HANA Live Using Design StudioTammy Powlas
Traffic Controller with SAP Design Studio on HANA...(designed for fun)Muralikrishnan E
Design Studio 1.0: Connect to SAP HANASAP (Official)
Design Studio 1.3: Start in SAP HANA modeSAP (Official)

 

 

Installation & Configuration

DocumentAuthor
BusinessObjects BI Platform 4.1 - Setting up an SSO connection to SAP HANA to utilize in Design Studio 1.1M. van Foeken
Design Studio 1.1 - Using an OLAP SSO connection on the BI 4.1 platform to SAP HANAM. van Foeken
Using Design Studio with SAP HANA end to end-Part 1Victor Gabriel Saiz Castillo
SAP BusinessObjects Design Studio 1.3 - Deployment on SAP HANAM. van Foeken
Getting Started on SAP Design Studio 1.3 powered by BW on HANA – Part 3ANIL BAVARAJU


Tips & tricks

DocumentAuthor

How To: Update SAP HANA table using XS - a simple demo

M. van Foeken

Murali Balreddy
BusinessObjects Design Studio 1.2 - How to change reference to SAP HANA views / package via .biapp fileM. van Foeken
Design Studio, BICS HANA and Group By Grouping Sets

Alexandre DUSSAC

How to analyze Code Coverage Results with SAP Design Studio on top of HANAMuralikrishnan E
SAP BusinessObject Design Studio - Best Practicesgandhii goditi

 

Best regards,

 

Victor

Some extra Performancy knowhows

$
0
0

Some lessons learned I wanted to share with you...

 

Design Studio 1.3

Sap Hana 1.0 SP7

 

  • Adding the same Datasouce or copying the first one makes no difference.
  • Both scenarios  have the same runtime

 

Initialsetupquery(Column:Measure,Rows:Dimension)

DS_1.loaddatasource();

DS_1.setFilter
  (Dimension,Value);


Measure=DS_1.getDataAsString("Ordered", {});

 

 

Initialsetupquery:(Column:Measure,Rows:/)

DS_1.loaddatasource();


DS_1.setFilter (Dimension,Value);


Measure=DS_1.getDataAsString("Ordered", {});


DS_1.MoveDimensionToRows(Dimension);



DS_1.setFilterExt("Year",var_end);



If (var_end != ””){


DS_1.setFilterExt("Year",var_end);


}

 

 

  • Make use of the Global Script Variables, set the value for the GSV once and reuse them

var_end = Convert.subString(APPLICATION.getInfo().dateNowInternalFormat, 0,4);

DS_1.setFilterExt("Year",var_end);

TILE_1_SUBTITLE.setText(var_end);

 

  • Get Data once and filter in later stages.

var var_range = var_start + " - " + var_prev;

DS_6.loadDataSource();

 

Get Data from DS_6 over Multiple years

 

DS_6.setFilterExt(("Year", var_range);

DS_6.setFilterExt("Vendor", var_vendor);

DS_6.setFilterExt("VendorName",var_name);

DS_6.setFilterExt("VATRegistration",var_vat);

 

Filter DS_6 in a later stage for one year

g_vim=(DS_6.getDataAsString("Counter", {"Year": var_prev}));

TILE_6_VALUE.setText(g_vim);

TILE_DETAILS_6_VALUE.setText(g_vim);

 

  • Set Dynamic variables on startup

var_end = Convert.subString(APPLICATION.getInfo().dateNowInternalFormat,0,4);

var_prev = Convert.floatToString((Convert.stringToFloat(var_end)) - 1);

var_prev = Convert.subString(var_prev,0,4);

var_start=Convert.subString(Convert.floatToString((Convert.stringToFloat(var_prev)) - 4),0,4);

var var_range = var_start + " - " + var_prev;

 

 

  • Merged variables does not work on hana when coping with different views.  Workaround =

        Global script varibale

             var_vendor string false false

        on startup

             var_vendor=DS_1.getVariableValueExt("HANA_VARIABLE_VENDOR");

             APPLICATION.doBackgroundProcessing();

        on background

             DS_3.setFilterExt("Vendor", var_vendor);

 

Design Studio SDK: CheckBox Group (with Image) Component

$
0
0

Purpose

today a checkbox group with image (as optional) visualization.

 

How does it looks like? (click to animate GIF)

chekcbox group, with corresponding image per entry.

20140925-185810_capture.gif

 

Styles
scn-pack-CheckBoxGroupthe group itself style
scn-pack-CheckBoxGroup-Layoutthe single entry layout style
scn-pack-CheckBoxGroup-Picturethe picture style
scn-pack-CheckBoxGroup-CheckBoxthe checkbox style
scn-pack-CheckBoxGroup-SelectedValuethe selected layout style (only active when images are available)


Available Properties

 

Property NameDescription
fallbackPicture

Url to the fallback picture (must be set if picture is selected)

withPicture

with picture flag

pictureSizepicture size, 16px or 32px as choice

 

Scripting Functions

 

ScriptsShort Description
void removeAllElements ()removes all elements

void addElement (String elementKey,

               String elementText,

               String imageUrl,

               boolean selected)

adds an element

void insertElement (String elementKey,

               String elementText,

               String imageUrl,

               boolean selected,

               int insertionIndex0based)

inserts element at index

void updateElement (String elementKey,

               String elementText,

               String imageUrl,

               boolean selected)

updates element at key
void deleteElement (String elementKey)deletes element
String getKeyAtIndex (int index)returns key at given index
org.scn.pack.KeyLabelArray getSelectedElementsArray ()returns an array of selected elements
void setSelectedKey (String key, boolean selected)sets element as selectd / unselected
void setSelectedKeys (String keys, String separator)sets many elements as selected (those which are not in the list are unselected)


Events

 

EventShort Description
onSelectionChangedEvent triggered when selection is changed

 

Example Application

An Application with example can be downloaded at the BIAPP Repository:

Releases

 

Source Code & Licensing

This component is for free use. It is under the Open Source Apache Version 2.0 License.

 

Important MaintenanceNotice (... as I am SAP Employee)

The component is NOT delivered under SAP maintenance license.

You cannot claim any Support on this component from SAP!


The components are created on "private" basis - you can use them as is. I can modify, correct or improve - but there is no obligation to do it. Of course I will try to correct bugs or improve the component as long I can.

 

Have Fun!

 

for other components see: Karol's SDK Components

 

Ps. only basic properties are attached, if some are missing - just make a comment.

LInk to SAPUI5: SAPUI5 SDK - Demo Kit


Create Cascading DropDowns / Filters using Universe as Datasource

$
0
0

In Design Studio, we would like to create 3 cascading dropdowns (Site > Area > Work Center) which will only show the corresponding areas / work centers in the dropdown list when user select a specific site / area.

 

Using universe as data source, we are not able to use the hierarchy defined within the universe.   To achieve the requirement, we use the following setup.

 

 

Setup

 

1. Define 3 global variables to hold user selected site, area and work center values.

GlobalVars.JPG

 

2. Define the data source query filter with optional prompt on both Site and Area.

 

DefineDSQuery.JPG

 

As the prompt is optional, all sites, areas and work centers are included when prompts have no value.

DSQueryResult.JPG

 

3. Create 3 dropdown for Site , Area and Work Center.  Fill up these 3 dropdowns in the "On Startup" application event using the defined data source DS_1.

OnStartup.JPG

 

4. In site dropdown "On Select" event.  Update global variable g_site, g_area and g_workCenter.  In this example we reset g_area and g_workCenter to default value to illustrate when g_site changed, existing g_area and g_workCenter needs to be invalidate.  Update DS_1 site and area prompts with the new values.

 

SiteOnSelect.JPG

 

5. In area dropdown "On Select" event.  Update global variable g_area and reset g_workCenter.  Update DS_1 area prompt with the selected area.

AreaOnSelect.JPG

 

 

6. In work center dropdown "On Select" event, update global variable g_workCenter.

WorkCenterOnSelect.JPG

 

 

7. In DS_1 "On Result Set Changed" event.  Update both area and work center dropdown.  As the area and work center dropdown are refreshed, set the dropdowns with user selected values.

OnResult.JPG

 

 

Result:

 

When application start, both prompts have no values and all dropdowns are not filter.

DropDownAll.png

By selecting a specific site from the site dropdown, both area and work center drop down are updated to show only area and work center under the selected site.

DropDownHouston.png

Selected a specific area will update the work center dropdown to show only work center under the selected area.

DropDownHoustonArea2.png

Selected a new site from the site dropdown will update both area and work center dropdown with all areas and work centers under the newly selected site.  It also reset the previous selected area and work center to "All".

 

DropDownManitoba.png

When a specific area is selected, the area dropdown will only contain 2 items.  To switch form a selected area back to all areas under the selected site, select the "All" item in the area dropdown, which will refresh both area and work center dropdown to show all areas and work centers again.

DropDownManitobaPierson.png

After selecting "All" in the area dropdown.

DropDownManitoba.png

Note:

Since we are using data source prompt, on each selection it will involve a round trip to update resultset.  This will impact the application performance.

Design Studio SDK: Data Bound Slider with Top / Pause Option

$
0
0

Purpose

A slider which can filter top / bottom data directly from a data source.


Implementatation & Learnings

I have used standard SAPUI5 slider (styled a bit to get rid of the colored) and attached data property, so you can bind it directly to the resultset. Any time you can pause the update.


On technical side I try slowly to understand the data and metadata structure - and externalize some generic methods to not copy paste them on component level.. this is what I have done already here.. DataUtils will collect for me such methods..

Capture.PNG

 


Visualization (animated gif, click to animate)

this examlpe is based on 2 data sources, one is filling the top products (the slider on top) and you see only the second one witj people in drill down

20141030-212408_capture.gif

 

What is In?

Basicly, another top / bottom component - I will extend this als with the value, currently only text is shown. you do not need to push this manually, as it is bound directly to the data source. only what is required is to pause refresh as the content is based on result set, so filtering is influencing the content (see on left side the vertical one, it filters themself).

 

  • data bound to a column
  • option of making it for Top X or Bottom X or Both (Top/Flop)


Data Binding

After you have assigned data source, open the data selection dialog and choose one column, or row with measures, like here:

Styles
<no styles for now>ups, forgot to put some


Available Properties

Property NameDescription
maxNumberMaximum number of displayed members
topBottomwhich direction should it visualize from data set, Top X or Bottom X
verticalvertical representation if set to true


Scripting Functions

ScriptsShort Description
String getSelectedKey ()returns the selected key
String getSelectedtext ()returns the texts of selected key


Events

EventShort Description
onSelectionChangedEvent triggered when selection has cahnged


Example Application

An Application with example can be downloaded at the BIAPP Repository (name SDK_DATASLIDER):


Runnable Content

 

Source Code & Licensing

This component is for free use. It is under the Open Source Apache Version 2.0 License.

 

Important MaintenanceNotice (... as I am SAP Employee)

The component is NOT delivered under SAP maintenance license.

You cannot claim any Support on this component from SAP!


The components are created on "private" basis - you can use them as is. I can modify, correct or improve - but there is no obligation to do it. Of course I will try to correct bugs or improve the component as long I can.

 

Have Fun!

 

for other components see: Karol's SDK Components or Karol's SDK Data Bound Components

Design Studio SDK: Collection Util Component

$
0
0

Purpose

Work with Collections with sorting feature. This is usefull when you have some arrays, which you want to put together and sort.

 

This component is created with collaboration with Michael Howles.

Thanks Michael for allowing the reuse of the sorting-code from your blog Design Studio SDK - Get Top/Bottom N rankings with a little less code, as response on my primitive blog How to get "Top X" our of resultset


Supports

Items with

  • key
  • label
  • value

-> See also available extensions in How to Use Extended Sdk Collection to handle "properties"

 

Functions

 

FunctionDescription

void setItems (

  /*keys*/ String keys,

  /*labels*/ String labels,

  /*values*/ String values,

  /*separator*/ optional String separator)

initialization with 3 arrays, ideally all 3 are equal, if not, the loop is on keys:

  • in case label array is shorter, empty label will be add
  • in case value array is shorter, 0 value will be add

 

Default Separator is comma ,

void addItem (

  /*key*/ String key,

  /*label*/ String label,

  /*value*/ String value)

you can add items one by one as well

String getKeys(

  /*separator*/ optional String separator)

keys separated by separator

 

Default Separator is comma ,

String getLabels(

  /*separator*/ optional String separator)

values separated by separator

 

 

Default Separator is comma ,

String getValues(

  /*separator*/ optional String separator)

values separated by separator

 

 

Default Separator is comma ,

void sortBy...()some sort methods (provided by Michael)
int getLength()length of current array

String getLabelByIndex(

  /* index */ int index)

getLabelByIndex

String getLabelByKey(

  /* index */ String key)

getLabelByKey

String getValueByIndexAsString(

  /* index */ int index)

getValueByIndexAsString

float getValueByIndex(

  /* index */ int index)

getValueByIndex

String getValueByKeyAsString(

  /* key */ String key)

getValueByKeyAsString

float getValueByKey(

  /* index */ String key)

getValueByKey

 

The Coolest Function

 

FunctionDescription

org.kalisz.karol.scn.pack.KeyLabelValueArray getAsKeyLabelValueArray (

  /**max members*/ optional int maxMembers)

returns the complete collection of keys, labels, values as JSON loopable object

 

maxMembers can restrict the length of the returned array

 

Example Application


20140915-234033_capture.gif


An Application with example can be downloaded at the BIAPP Repository:

Releases

 

Source Code & Licensing

This component is for free use. It is under the Open Source Apache Version 2.0 License.

 

Important MaintenanceNotice (... as I am SAP Employee)

The component is NOT delivered under SAP maintenance license.

You cannot claim any Support on this component from SAP!


The components are created on "private" basis - you can use them as is. I can modify, correct or improve - but there is no obligation to do it. Of course I will try to correct bugs or improve the component as long I can.

 

Have Fun!

 

for other components see: Karol's SDK Components

Design Studio SDK: Opening Window with POST (allows many parameters)

$
0
0

Update / 24.10.2014

Small corrections for the component, eg. opening the same window again is working, and there is a fallback option in case the window is already opened.


Purpose

Generic Drag & Drop Control for all use cases. I have styled it a bit, now it can be used.

 

This component is created as response to APPLICATION.openNewWindow when upper limit to URL length is hit

 

How does it looks like?

the URL boundaries (2048 characters or so) can be only overcome via POST method.

 

Available Properties

 

Property NameDescription
url

Url which should be opened

windowId

NEW (24.10.2014)

Id for the window (same id means that the window can be reused)

fallbackSencario

NEW (24.10.2014)

option to decide what to do in case the window is already open

 

Scripting Functions (preview)

 

ScriptsShort Description

void setWindowId (

  /**window id*/String windowId)

NEW (24.10.2014)
you can set window id to open more windows

void setUrl (

  /**url*/String url)

NEW (24.10.2014)

you can set the url per script

void triggerExecution ()

triggers the execution of opening the URL

void addParameter (

  /**name*/String name,

  /**value*/String value)

allows to add parameters to the URL via name / value pairs
void removeAllParameters ()removes all parameters

 

Example Implementation for this call:

 

OPENWINDOWPOST_1.removeAllParameters();
OPENWINDOWPOST_1.setUrl("http://localhost:55555/aad/web.do");
OPENWINDOWPOST_1.addParameter("APPLICATION", "SDK_OPENWINDOW_POST");
OPENWINDOWPOST_1.addParameter("designersessionid", "25d9c2721c084d8c98684721835379d8");
OPENWINDOWPOST_1.triggerExecution();

Comparison before and after


     Assumption:

     you want to call URL http://localhost:8080/web.do?P1=V1&P2=V2


     Technical View:

          URL: http://localhost:8080/web.do

          Param1: P1

          Value1: V1

          Param2: P2

          Value2: V2


     Your code before:

 

var url = "http://localhost:8080/web.do";
url = url + "?";
url = url + "P1" + "=" + "V1";
url = url + "P2" + "=" + "V2";
APPLICATION.openNewWindow(url);

     Your code after:


     1) in Properties View you have tto set the url property to "http://localhost:8080/web.do"


     2) in script you need to add all parameters:

 

 

OPENWINDOWPOST_1.removeAllParameters();
OPENWINDOWPOST_1.addParameter("P1", "V1");
OPENWINDOWPOST_1.addParameter("P2", "V2");
OPENWINDOWPOST_1.triggerExecution();


This code will create a "form" in browser and submit the content via POST.


Example Application

An Application with example can be downloaded at the BIAPP Repository:

Releases

 

Source Code & Licensing

This component is for free use. It is under the Open Source Apache Version 2.0 License.

 

Important MaintenanceNotice (... as I am SAP Employee)

The component is NOT delivered under SAP maintenance license.

You cannot claim any Support on this component from SAP!


The components are created on "private" basis - you can use them as is. I can modify, correct or improve - but there is no obligation to do it. Of course I will try to correct bugs or improve the component as long I can.

 

Have Fun!

 

for other components see: Karol's SDK Components

Compilation of links: Using Design Studio with SAP HANA

$
0
0

Hello Everyone,

 

here a compilation of links regarding the usage of Design Studio using SAP HANA as backend or platform:

 

General

DocumentAuthor
Using Design Studio with SAP HANA end to end-Part 2Victor Gabriel Saiz Castillo
Design Studio 1.3 on HANA PlatformPoovin Kumar V
My experience with SAP BO Design Studio on HANAMuralikrishnan E
Getting Started on SAP Design Studio powered by BW on HANA – Part 1ANIL BAVARAJU
Getting Started on SAP Design Studio 1.3 powered by BW on HANA – Part 2ANIL BAVARAJU
Sharing the Knowledge - SAP TechEd HANA Live Using Design StudioTammy Powlas
Traffic Controller with SAP Design Studio on HANA...(designed for fun)Muralikrishnan E
Design Studio 1.0: Connect to SAP HANASAP (Official)
Design Studio 1.3: Start in SAP HANA modeSAP (Official)

 

 

Installation & Configuration

DocumentAuthor
BusinessObjects BI Platform 4.1 - Setting up an SSO connection to SAP HANA to utilize in Design Studio 1.1M. van Foeken
Design Studio 1.1 - Using an OLAP SSO connection on the BI 4.1 platform to SAP HANAM. van Foeken
Using Design Studio with SAP HANA end to end-Part 1Victor Gabriel Saiz Castillo
SAP BusinessObjects Design Studio 1.3 - Deployment on SAP HANAM. van Foeken
Getting Started on SAP Design Studio 1.3 powered by BW on HANA – Part 3ANIL BAVARAJU


Tips & tricks

DocumentAuthor

How To: Update SAP HANA table using XS - a simple demo

M. van Foeken

Murali Balreddy
BusinessObjects Design Studio 1.2 - How to change reference to SAP HANA views / package via .biapp fileM. van Foeken
Design Studio, BICS HANA and Group By Grouping Sets

Alexandre DUSSAC

How to analyze Code Coverage Results with SAP Design Studio on top of HANAMuralikrishnan E
SAP BusinessObject Design Studio - Best Practicesgandhii goditi

 

Best regards,

 

Victor

Transporting SAP Design Studio Applications on the HANA Platform – Part 01

$
0
0

Transport / Promotion management is the backbone of a landscape that makes it easier for administrators when content needs to be moved. Transporting SAP Design Studio applications from one environment to another in SAP HANA is done with the help of ‘Delivery Units’.

 

All Analysis applications published on the SAP HANA platform are placed in a package named ‘designstudio’ and all custom extensions installed, in the package ‘designstudio_extensions’. For more information on "SAP Design Studio on the SAP HANA platform", please read my previous blog.

 

Prerequisites to create Delivery Units

Delivery unit information is maintained in the _SYS_REPO schema. The content vendor name should be configured to create DU (Delivery Units). The user account used to create the delivery unit should have insert rights on _SYS_REPO (generally, modeling rights) and the system privilege ‘INIFILE ADMIN’.

 

To configure the vendor name for delivery unit creation, select the Configuration tab and expand the ‘indexserver.ini’ option. Select ‘repository’ and add a new parameter. The parameter is a Key-Value pair. The key is ‘content_vendor’ and the value is the name of your company.

 

Prerequisites to create Delivery Units


Creating a Delivery Unit

Delivery units are SAP HANA specific packages that can be used to install content, transport data models and applications developed on the SAP HANA platform. The delivery unit management window can be accessed through the ‘Modeler Perspective’ in SAP HANA Studio. Once a delivery unit is created, it can either be exported as a package to the target system or the target system can pull the DU from the source system, using ‘SAP HANA Transport Management’.

 

Step 1:

In SAP HANA Studio, select the ‘SAP HANA Modeler’ perspective and select ‘Delivery Units’ under ‘Setup’. This will open the ‘Delivery Units Management’ window.

Delivery Units Management

 

Step 2:

Click the ‘Create’ button on the right corner to create a new DU.

 

Create a new DU

Step 3:

Fill up all the information in the ‘New Delivery Unit’ form. ‘Name’ is mandatory.

 

New Delivery Unit form

 

Step 4:

Now select the newly created delivery unit and click on ‘Add’. This will help us add packages to the DU.

 

Add packages to DU

 

Step 5:

As mentioned earlier, all analysis applications are placed inside the ‘designstudio’ package and each application is maintained as a separate sub-package. Browse for the ‘designstudio’ package and select the analysis application (sub-package) that is to be promoted.

 

Select the Analysis Application

 

Now we have created a delivery unit for the analysis application that needs to be promoted. This can be used with manual export/import or transports.

 

Exporting the Delivery Unit

Step 1:

In SAP HANA Studio, select ‘Export’ in the ‘File’ menu.

 

Exporting the Delivery Unit


Step 2:

Select ‘Delivery Unit’ in the ‘SAP HANA Content’ folder and select ‘Next’.

 

‘Delivery Unit’in SAP HANA content folder

 

Step 3:

If you have configured many systems in your SAP HANA Studio, select the system from which you need to export the DU. You should have the EXPORT system privilege to perform this operation.

 

Export system privilege


Step 4:

Now

  1. Select the delivery unit we created for the analysis application
  2. Select the ‘Export to Client’ option
  3. Browse for the location where the file should be saved
  4. Type the desired name for the delivery unit, without changing the file extension

 

Select the delivery unit

 

When done, click ‘Next’ to proceed.

 

Step 5:

Click ‘Finish’ to export the delivery unit. The package will be saved in the location specified.

 

‘Finish’ to export the delivery unit

 

Importing the Delivery Unit

Step 1:

In SAP HANA Studio, select ‘Import’ from the ‘File’ menu and select ‘Delivery Unit’ in the ‘SAP HANA Content’ folder. You should have the IMPORT system privilege to do this.

 

Importing Delivery Unit

 

Step 2:       

Select the ‘Target’ SAP HANA system and click ‘Next’.

 

Target HANA system

 

Step 3:

Now

  1. Select ‘Client’, as the location of the delivery unit
  2. Browse for the delivery unit that needs to be imported
  3. Click ‘Finish’ to initiate the import

‘Client’ as location of the delivery unit

 

Step 4:

When Import is complete, the Job Status will change to ‘Success’. Now, the SAP Design Studio application will be active in the target system.

 

Design Studio application Active

We can access the promoted application just by using the following URL format

 

http://<hostname>:<port>/sap/bi/aas/rt/index.html?APPLICATION=<APP_NAME>

 

Remember to transport the data models used by the application, as well. Data models can also by transported the same way, using delivery units, if development has been done based on best practices.

 

We have promoted an analysis application from one environment to another using direct export/import. Let us explore how to use SAP HANA Transport Management to do this – in part 02 of this blog.

 

source : http://visualbi.com/blogs/design-studio/transporting-sap-design-studio-applications-hana-platform-part-01/

Transporting SAP Design Studio Applications on the HANA Platform – Part 02

$
0
0

This blog is a continuation of my previous post about Transporting Analysis Applications on the SAP HANA Platform. In the previous blog, I had discussed about transporting SAP Design Studio Applications manually from source to target systems by creating Delivery Units. Now, let us explore how to use the ‘SAP HANA Transport Management’ tool for the same. Transport Management in SAP HANA works differently when compared to its SAP counterparts (NetWeaver and Business Objects).

 

In the other two, Promotion Management (Business Objects) and CTS (NetWeaver), the source pushes the objects to the target. However in SAP HANA, the target pulls the objects from the source. To transport/promote analysis applications, we need to configure a source system in the target SAP HANA server and pull the delivery units available in the source server.

 

Setup LCM in SAP HANA Studio

Step 1:

In SAP HANA Studio, right click on the target SAP HANA system and select ‘Transport Management’ in ‘Lifecycle Management’.

 

‘Transport Management’ in ‘Lifecycle Management’

 

Step 2:

The LCM window will prompt for the SAP HANA server’s ‘Operating System’ user credentials. The username is in the format  <SID>ADM, where <SID> is your SAP HANA system ID. Enter the credentials and click finish to start LCM.

 

Note: Do not use the SYSTEM user ID to start LCM. You have to use the Operating System user ID.

 

Now LCM is up and available for use. We have to configure the source system in the target server.

 

Configure Source System

Step 1:

Select the ‘System’ tab in the ‘Transport Management’ window and click on ‘Register’. This will display a pop-up window to input the source system details. To perform such operations, the user is advised to have the ‘sap.hana.xs.lm.roles::Administrator’ role in the target server.

 

‘System’ tab


Step 2:

Enter the source system details in the ‘Register System’ pop-up and click next to continue.

 

Register System


Step 3:

In the confirmation window, click on ‘Maintain Destination’. This will bring the HTTP Destination (SAP HANA specific format to store HTTP server information with credentials) configured in the source system. To do this you need to have the roles ‘sap.hana.xs.admin.roles::HTTPDestAdministrator’ (just for HTTP Dest) and ‘sap.hana.xs.admin.roles::RuntimeConfAdministrator’(for all such config) in the source system.

 

Maintain Destination


Step 4:

Enter the transport service account credentials of the source system. The transport service account can be any name but should be assigned to the role ‘sap.hana.xs.lm.roles::Administrator’ to perform all transport operations in the source system. Click on ‘Save’ to complete the process. And ‘Finish’ to add the source system.


Transport service account credentials


Step 5:

Now under the ‘System’ tab, we see two systems. The green check in status shows that the source system has been correctly configured and is reachable.

 

Note: Even a small time difference of say less than a minute will make the servers go out of sync. Ensure they have the exact same time and that all necessary roles are assigned to the service account.

 

Systems in ‘System’ tab

 

Now that we have configured the source system, we need to create a transport route and pull the package from the source.


Transport Route Creation

Step 1:

Click on ‘Add’ in the ‘Routes’ tab. Select options in the ‘Add Route’ form.

  1. Select the source system
  2. Select the transport type. Generally ‘Full Delivery Unit Transport’ for a fresh transport
  3. Select ‘DU Transport’
  4. Select the delivery unit created for the analysis application
  5. Enter a comment and click on ‘OK’ to add the route

 

‘Add’ in the ‘Routes’ tab


Step 2:

In the ‘Transports’ tab, select the route configured for SAP Design Studio and click ‘Start Transport’. To do this the user should have ‘sap.hana.xs.lm.roles::Transport’ and ‘sap.hana.xs.lm.roles::ExecuteTransport’ roles assigned to him in the target server.

 

‘Transports’ tab


Step 3:

Click ‘OK’ to start the Transport.

 

Start the Transport


Step 4:

Transport will log all the status changes which can be tracked in the ‘Logs’ tab. The green square shows successful transports. Also, ensure you transport the data models used by the analysis application.

 

‘Logs’ tab

 

Also make sure to transport the data models used by the Analysis application.

 

Hope these two blogs helped you learn about transports on the SAP HANA platform. Follow this series of posts, for updates on this.

Happy Learning !

 

source : http://visualbi.com/blogs/design-studio/transporting-sap-design-studio-applications-hana-platform-part-02/


What's Coming in Design Studio 1.4 SDK

$
0
0

During Design Studio 1.4 development we were able to put some improvements into the Design Studio SDK. Now, as most of the new features of Design Studio 1.4 are announced, it is time to lift the covers from this stuff, which you as a SDK component developer may find useful.

 

New Extension Types

 

Design Studio 1.4 supports two new extension types:

 

CVOM/Lumira SDK Chart Extensions

 

Both Design Studio and Lumira use a common chart library implemented by colleagues from Shanghai and having about 100 built-in chart types. Since a few months this chart library can even be extended with custom chart types using an new SDK. You can use this SDK, originally called CVOM SDK, now Lumira SDK, to implement new visualizations for Lumira. You can import such a new vizualization for Lumira into Design Studio using this menu item in Design Studio:

installCVOMExt.png

The CVOM SDK defines concepts and APIs of its own that differ significantly from the Design Studio SDK. This is necessary, as the CVOM SDK forms a common abstraction layer over the data model of Lumira, Design Studio, and potential other chart containers.

 

The CVOM SDK also provides a tool called VizPacker that comes with Lumira Desktop. It's a kind of IDE to create and pack extensions. An extension is a ZIP file containing some JavaScipt files and metadata in JSON format. When you import such an extension into Design Studio, it is wrapped into an Eclipse plugin conforming to the Design Studio SDK specification. Thus you can manage it (deploying it to BIP, NW, or HANA) like any other Design Studio SDK extension.

 

Should you implement a component as a Lumira SDK extension or a Design Studio SDK extension? Here are my thoughts:

  • If it is a chart AND
  • it should be used in both Design Studio and Lumira products AND
  • it doesn't need to fire Design Studio scripting events nor contribute itself to Design Studio scripting

you should consider using the Lumira SDK. Otherwise consider using the Design Studio SDK.

 

Custom Data Sources


Up to now you can only use data sources based on

  • BW Cubes and Queries
  • HANA Analytic and Calculation Views
  • BI Universes (some supported types)

 

 

Now you can implement your own data sources.Here are some ideas what you could do:

  • Connect to a Web Service delivering real time data (for example stock quotes)
  • Connect to a data base (for example exposed by a Web Service)
  • Load a CSV file and provide the data
  • Combine the data of two data sources
  • Enrich data from a data source with extra rows and columns, including simple calculations

 

Custom data sources are very similar to data-bound SDK components. But instead of consuming data in Design Studio SDK's JSON format, they produce it:

DS-SDK.png

Because custom data sources produce Design Studio SDK JSONs, they can be used with any data-bound Design Studio SDK component and SAP charts. Thus, the components that don't work with custom data sources are the Crosstable and the filter components like Filter Panel, Dimension Filter, etc).

Implementing a data source is not very different from implementing a component: You need

  • a contribution.xml file (using handler_type="datasource")
  • a contribution.ztl file and
  • a handler JavaScript file.

 

In the handler JavaScript file you can choose from building your custom data source on one of two provided base classes:

  • Implementing a data source directly on the SdkDataSource base class requires you to implement the function fetchData(oSelection, oOptions). This may be challenging as you are responsible to implement aspects like selecting the appropriate data, etc. on your own.
  • To make it easier, you may consider using the base class SdkDataBuffer. It provides the easy-to-use function setDataCell to fill a data buffer and several other helper functions. All details like, for example, selecting data and creating the correct JSON are already built-in this base class.

 

We will post more information later -- at the latest with the official release of the product -- including an updated Developer Guide and several new samples, for example this one:

static_ds.png

 

General Improvements

 

Delta Rendering


A feature that was planned from the beginning of the SDK, which finally made it into Design Studio 1.4, is the technique only to send changed properties over the wire. This will improve performance. In the past, all properties were sent with any change in the SDK component. The setter was only called for modified properties. This was achieved by a trick: The getter was called first and only if the new property value was different, the getter was called. Now the backend calculates if a property might need an update. Thus the getter is not called anymore before the setter.

If you rely on the call to the getter, you might need to adjust your component.

 

New Method

 

The new method this.firePropertiesChangedAndEvent(aProperties, sEvent) is like a combination of

  • firePropertiesChanged(aProperties) and
  • fireEvent(sEvent)

but is faster, as there is only one round-trip needed.

 

Improvements for Data-Bound Components

 

Options for Data-Bound Properties

 

Currently the only way to customize which data a data-bound property receives is the property type. In Design Studio 1.4 we now introduce the possibility to specify options for data-bound properties. In your contribution.xml file you specify them as <option> sub-element of your property. Here is a data property of the SimpleCrosstab sample SDK extension updated for Design Studio 1.4:

 

<property id="data" title="Data Selection" type="ResultSet"  group="DataBinding">  <option name="includeFormattedData" value="true"/>  <option name="includeData" value="false"/></property>

The new options allow you to finer control what data you need. There are also some options to request which data - which was not available so far. Especially the includeFormattedData option is great for table-like SDK components that simply show cell data without additional calculations or formatting.

 

The following table lists the available option names of data-bound properties:

Option Name

 

Description

includeAxesTuplesIf true then the JSON properties axis_rows and axis_columns are included in the Data Runtime JSON. They contain the tuples of the row axis and column axis.
includeTuplesIf true then the JSON property tuples is included in the Data Runtime JSON. It contains the tuples of the data.
includeResultsIf true then the result values, for example totals, are included in the Data Runtime JSON.
presentationDelimiterString that separates presentations of dimension member values in the text JSON property of dimension members in the Metadata Runtime JSON
selectionShapeInteger value that indicates the geometry of the data in the Data Runtime JSON. Valid values are: 0 (ResultCell), 1 (ResultCellList), or 2 (ResultCellSet orResultSet).
swapAxesIf true then the axes (and the relevant data) are swapped (transposed) in the Data Runtime JSON and Metadata Runtime JSON.
includeDataIf true then the JSON property data is included in the Data Runtime JSON. It contains the data values (float numbers or null).
includeFormattedDataIf true then the JSON property formattedData is included in the Data Runtime JSON. It contains the formatted data values as strings.
includeMetadataIf true then the Metadata Runtime JSON is included as a part of the Data Runtime JSON.
fillMetadataPropertyIf true then the SDK component's implicit property metadata contains the Metadata Runtime JSON.

 

You should consider to modify your component to ask for just the data that your code needs. Less data sent over the wire makes your component faster.

In fact, the new options remove the need for different data-bound property types. Now the difference between ResultCell, ResultCellList, ResultCellSet, and ResultSet are simply different default values:

 

Default Value for Property Type...
Option NameResultCellResultCellListResultCellSetResultSet
includeAxesTuplesfalsefalsefalsetrue
includeTuplestruetruetruetrue
includeResultstruetruetruetrue
presentationDelimiter||||
selectionShape0122
swapAxesfalsefalsefalsefalse
includeDatatruetruetruetrue
includeFormattedDatafalsefalsefalsefalse
includeMetadatafalsefalsefalsetrue
fillMetadataPropertytruetruetruefalse

 

External Measures

 

There are cases when measure dimensions are neither on the rows nor on the columns of a result set (having field "containsMeasures=true"): In the Query Designer or the Initial View Editor you could have filtered your measures structure to a single member and then put it into the background or free axis.

In the Design Studio 1.3 SDK you would get a number, but no metadata about the number, for example no format string, no scaling factor, etc. Now you receive metadata about the measure in a new field:

 

"dimensions": [ */ here are the normal dimensions on columns and rows */ ],
"externalDimensions":[           {            "key":"Keyfigures",            "text":"Key\x20Figures",            "axis":"FREE",            "axis_index":2,            "containsMeasures":true,            "members":[             {              "key":"0D_NWI_NSAL",              "text":"Net Sales",              "scalingFactor":0,              "unitOfMeasure":"$",              "formatString":"#,##0.00 $;'-'#,##0.00 $"             }            ]

Note that custom data sources are also responsible to create such field if needed - and the data buffer provides some help for it.

 

New Runtime JSON Properties

 

If you have a data-bound property of type ResultCellSet, it is quite difficult to create the 2-dimensional layout for the data, as you receive the data in a 1-dimensional array that was filled line by line. To break up the latter array into the correct rows, you need the number of columns - with the new JSON property rowCount. For completeness, there is also a columnCount JSON property. If your property is ResultCellList or ResultCell one or both of the JSON properties are 1.

 

Advanced Features

 

There are some new features that are quite tricky and complicated, but could be valuable for some advanced users and use cases.

 

Limited Require.JS Support

 

To support the CVOM SDK we needed a way to use require.js modules. Require.js is a module system for JavaScript. It allows to load JavaScript files asynchronously and informes you once the needed module is available. The best thing however is that you get rid of global variables. Anything a require.js module provides is injected into the caller's callback.

 

Design Studio was initially developed without require.js. However, many open source libraries detect if require.js is present and behave differently, for example by not exposing global variables and defining a require.js module.

 

Unfortunately, in Design Studio 1.3 it can happen that require.js is loaded. This happens if the page contains a chart: The CVOM libraries contain require.js - and if the open source library that comes with your SDK component is loaded after CVOM, it might behave strange. You may see require.js error messages and the expected global variables are missing.

 

In Design Studio 1.4 you can load all require.js/AMD enabled libraries with require.js instead of including them via <jsInclude>:

 

sap.zen.Dispatcher.instance.require(["path1/module1", "path1/module1"], function(module1, module2) {  sap.designstudio.sdk.Component.subclass("com.sap.sample.coloredbox.ColoredBox", function() {      // Your handler code here, using module1 and module2  });
});

You need to use the function sap.zen.Dispatcher.instance.require instead of normal require to ensure that your handler is not used to early. The Design Studio JSON processing is automatically delayed util all modules are loaded. The module names/paths are relative to your handler file. If the name is unique, there is even a chance to load different versions of the same libraries without conflict. SAP would however not guarantee that this will always work.

 

Binding Events to Design Studio Script Methods

 

Normally, an SDK component can't modify data sources or other components, at least not directly. Of course, a component can expose an event and in the event handler the user of the component can write some Design Studio script that does some modification, for example, DS_x.setFilter, etc. But the SDK component so far has no direct access to the Design Studio script API.

Now this is possible, even if it is kind of indirect:

  1. Define an invisible property of type ScriptText.
  2. Define one or more visible or invisible properties that transport the arguments that you need for Design Studio scripting.
  3. In your contribution.ztl, define a private function. In the body you can call any Design Studio script function you want, including the full JavaScript language.
  4. Bind the event to the Design Studio script method.

 

The following snippets show how a component could call the Desing Studio script method clearFilters() with a given dimension name.

In the contribution.xml file we define an invisible even onclear and an invisible property for the dimension parameter called dimension.

 

<sdkExtension ...>  <component ...    <jsInclude>res/js/component.js</jsInclude>    <property      id="onclear"      type="ScriptText"      visible="false" .../>     <property      id="dimension"      type="Script"      visible="false" .../>    <initialization>      <defaultValue property="onclear">this.doClearFilter();</defaultValue>    </initialization>  </component></sdkExtension>

In the initialization section we bind the onclear event to the doClearFilter Design Studio script method.

The function itself is marked private so that it can't be called from normal Design Studio scripts. It also uses getDataSource() to access the bound data source and call the Design Studio scipt method clearFilters, passing in the value of the invisible field dimension.

 

@Visibility(private)
void doClearFilter() {*    this.getDataSource().clearFilters(this.dimension);
*}

 

On Browser side, you can now invoke your Design Studio script method with this snippet:

this.dimension("Dim1");
this.firePropertiesChangedAndEvent(["dimension"], "onclick");

First you set the invisible dimension property to the value you like. Then you tell the server that the property value has changed and fire the invisible event.

 

Pseudo Event "beforeRender"

 

In conjunction with the Design Studio script event binding described before, there is another little powerful feature: the built-in pseudo event beforeRender.

This event happens always before the properties are send from server to browser. It allows you to call some Design Studio script methods to initialize some (invisible or visible) properties before they are sent to your handler JavaScript.

 

Imagine you want to implement a listbox that automatically displays all dimensions of a bound data source. Here is what you have to do:

  • Create a invisible property, for example, dimensions.
  • Bind the beforeRender event to a private Design Studio script method, for example, onBeforeRender.
  • In onBeforeRender call the Design Studio script method getDimensions(), stringify the result and assign it to your dimensions property.
  • In you handler JavaScript file receive the dimensions property, parse it to a JSON and fill you listbox.

 

Note that in the beforeRender event you are only allowed to perform "read-only" operations, like getDimensions(), getMembers(), getData(), etc., but not modifying operations like setFilter().

 

That's all for Design Studio 1.4. Let's see how long the list will be for coming releases. I'm looking forward to your comments, proposals, suggestions, etc.

Design Studio SDK: Data Bound Range Slider

$
0
0

Purpose

A range slider which can filter top / bottom data directly from a data source.


Implementatation & Learnings

I have used standard SAPUI5 range slider and attached data property, so you can bind it directly to the resultset. Any time you can pause the update. as there seems to be some issue with vertical slider in my SAPUI5 version, for now only horizontal is allwoed.


On technical side - I have extended my externalized generic method to read top/bottom members (added sorting and duplicates handling) in DataUtils.

Capture.PNG

 


Visualization (animated gif, click to animate)

this examlpe is based on 1 data source, one is filling all members w/o sorting on value (default sort is on key) and the second is selecting the top and bottoms.

20141103-193402_capture.gif

 

What is In?

Basicly, another top / bottom component - I will extend this als with the value, currently only text is shown. you do not need to push this manually, as it is bound directly to the data source. only what is required is to pause refresh as the content is based on result set, so filtering is influencing the content (see on left side the vertical one, it filters themself).

 

  • data bound to a column
  • option of making it for Top X or Bottom X or Both (Top/Flop)
  • option to sort by value or keep default (you have to sort on key to use the real range selection)


Data Binding

After you have assigned data source, open the data selection dialog and choose one column, or row with measures, like here:

Styles
<no styles for now>ups, forgot to put some


Available Properties

Property NameDescription
maxNumberMaximum number of displayed members
topBottomwhich direction should it visualize from data set, Top X or Bottom X
sorting"By Value" or "Default"


Scripting Functions

ScriptsShort Description
String getSelectedKey ()returns the selected key
String getSelectedText ()returns the text of selected key
String getSelectedKey2 ()returns the selected key 2
String getSelectedText2 ()returns the text of selected key 2
String getSelectedKeys ()returns all keys in selected range separated by ;


Events

EventShort Description
onSelectionChangedEvent triggered when selection has cahnged


Example ApplicationAn Application with example can be downloaded at the BIAPP Repository (name SDK_DATARANGESLIDER):


Runnable Content

 

Source Code & Licensing

This component is for free use. It is under the Open Source Apache Version 2.0 License.

 

Important MaintenanceNotice (... as I am SAP Employee)

The component is NOT delivered under SAP maintenance license.

You cannot claim any Support on this component from SAP!


The components are created on "private" basis - you can use them as is. I can modify, correct or improve - but there is no obligation to do it. Of course I will try to correct bugs or improve the component as long I can.

 

Have Fun!

 

for other components see: Karol's SDK Components or Karol's SDK Data Bound Components

Customizations: Using CSS in SAP Design Studio Dashboards

$
0
0

In many of our client dashboards, we use patterns created using CSS in SAP DesignStudio, for the background. Though we could just as well use images, using CSS patterns helps us come up with some really creative and interesting backgrounds. And as we know, CSS is light weight, responsive and also loads quicker than regular images. Using the right patterns can also make a huge difference on the overall user experience.

Steps for using CSS in SAP Design Studio

1) Insert a Textbox in the Application and set the Width and Height to auto and Margins to 0.

textbox-in-sap-design-studio.png

2) Now insert the CSS code in the CSS Style Editor, as shown below.

background:

linear-gradient(27deg, #151515 5px, transparent 5px) 0 5px,

linear-gradient(207deg, #151515 5px, transparent 5px) 10px 0px,

linear-gradient(27deg, #222 5px, transparent 5px) 0px 10px,

linear-gradient(207deg, #222 5px, transparent 5px) 10px 5px,

linear-gradient(90deg, #1b1b1b 10px, transparent 10px),

linear-gradient(#1d1d1d 25%, #1a1a1a 25%, #1a1a1a 50%, transparent 50%, transparent 75%, #242424 75%, #242424);

background-color: #131313;

background-size: 20px 20px;

css-editor-sap-designstudio.png

css-sap-designstudio.png

3) Another way is to use CSS Class. Insert an Image component in the application.

css-class-image-component.png

4) Create a CSS file with Class ‘patterns’.

css-patterns.png

5) Now set the CSS Class for the Image component to ‘patterns’. That’s all there is to it! The main part of the effort is in creating an effective background using CSS in SAP DesignStudio

patterns.png

source: http://visualbi.com/blogs/design-studio/css-in-sap-designstudio/

How to create a chart selector list

$
0
0

The goal of this document to explain how you can make an charttype selector.  When we click on the chart tab we want to see a list of possible charttypes selectable for the user.

 

 

0000Capture.PNG

we create a POPUP component, inserted a GRID component ROW=6 COLUMN=1

 

Set WIDTH, Height and the positioning of your popup, in the grid you can set width/height to auto and the other parameters to 0.

 

Put in every column a BUTTON component, set as class:

  1. ICON_CHART_PIE
  2. ICON_CHART_LINE
  3. ICON_CHART_RADAR
  4. ICON_CHART_BAR
  5. ICON_CHART_COLUMN
  6. ICON_CHART_BUBBLE

0000Capture.PNG

BUTTON >> Event scripting:

 

CHART.setChartType(ChartType.PIE); respectively for each button.

 

If you want the popup disappear after selection set also: POPUP.hide();

 

On the footer-graph-Icon we have scripted on event: POPUP.show();

On the footer-table-Icon we have scripted on event: POPUP.hide();

Design Studio SDK: Data Bound Leader Board (Top/Bottom Selection)

$
0
0

Purpose

Visualize top or bottom members based on the full result set. As you do not always have access to query level, you can use this component for "client side" filtering and sorting - and at the end show only the top 5 members.


Visualization

similar to the original of Design Studio SDK: Leader Board Component, with the big difference: you do not need to fill it in manually.

 

As usual, some animated gif (click to animate):

20141016-224722_capture.gif

 

What is In?

First of all, this is my first data bound component, so probably it is not perfect.. I have just tested it with a simple query, and it is set to only single row/column selection for data binding.

 

  • you can bind data as commonly defined in SDK - data source and data selection properties are available
  • you can set some properties, currently only in the design time (perhaps later some BIAL functions can be add - on request, requirement)
  • you can assign fallback picture and when you place at the same location other pictures with keys, you get also pictures visible
  • option of making it for Top X or Bottom X

 

Data Binding

After you have assigned data source, open the data selection dialog and choose one column, or row with measures, like here:

data_leaderboard_databinding.PNG


Styles
scn-pack-DataLeaderBoardthe complete board
scn-pack-DataLeaderBoard-ValueLayoutsingle value layout
scn-pack-DataLeaderBoard-IndexTextindex text
scn-pack-DataLeaderBoard-Linklink
scn-pack-DataLeaderBoard-Picturepicture
scn-pack-DataLeaderBoard-Texttext
scn-pack-DataLeaderBoard-SelectedValueselected value


Available Properties

 

Property NameDescription
fallbackPicture

the picture which should be visible if value-picture does not exist (must be maintained!)

usePicturesallows to switch off display of pictures (in example 2)
maxNumberMaximum number of displayed members
topBottomwhich direction should it visualize from data set, Top X or Bottom X
addCounterdisplays the counter on left side
valuePrefix

prefix for the text which is displaying the value

valueSuffixsuffix for the text which is displaying the value
addCounterflag for counter (if true, the numbers on left side will be visible)
decimalPlacescurrently can be changed manually, it is not bound to the data source display

 

data_leaderboard.PNG

 

Work with Images

you can assign images to the entries, the image must be named as the key and the extensions must be same as the extension of fallback image. In case the image cannot be taken from repository (not existing) - fallback image will be shown.

data_leaderboard_pictures.PNG


Scripting Functions

 

ScriptsShort Description
String getSelectedKey ()returns the selected key
String getPressedKey ()returns the pressed key (by click on the link)

 

Events

 

EventShort Description
onSelectionChangedEvent triggered when selection has cahnged
onPressEvent triggered when user press on the link

 

Example Application

An Application with example can be downloaded at the BIAPP Repository (name SDK_DATA_LEADERBOARD):

Releases

 

Source Code & Licensing

This component is for free use. It is under the Open Source Apache Version 2.0 License.

 

Important MaintenanceNotice (... as I am SAP Employee)

The component is NOT delivered under SAP maintenance license.

You cannot claim any Support on this component from SAP!


The components are created on "private" basis - you can use them as is. I can modify, correct or improve - but there is no obligation to do it. Of course I will try to correct bugs or improve the component as long I can.

 

Have Fun!

 

for other components see: Karol's SDK Components or Karol's SDK Data Bound Components

Viewing all 575 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>