Category Archives: MicroStrategy Mobile

Creating a custom radio button in MicroStrategy Mobile to change panels

Hello there,

I would like to share this implementation that I did for mobile devices. In this case, I had to create a custom radio button using an HTML Container with CSS and JavaScript to change the panels of a panel stack.

The trick is to create anchors with your URL API parameters to change the panels based on the click of the radio button.

I have one function per button in this case, but you can improve it to use only one.

You just need to create an HTML Container and past this code below:

<!DOCTYPE html>

<html lang="en-gb">

<head>

<meta charset="UTF-8">
<style>

.buttons{

margin-bottom : 1.5em;

}

input[type=radio   ]:not(old){

width     : 2em;

margin    : 0;

padding   : 0;

font-size : 1em;

opacity   : 0;

}

input[type=radio   ]:not(old) + label{

display      : inline-block;

margin-left  : -2em;

line-height  : 1.5em;

}

input[type=radio   ]:not(old) + label > span{

display          : inline-block;

width            : 0.875em;

height           : 0.875em;

margin           : 0.25em 0.5em 0.25em 0.25em;

border           : 0.0625em solid rgb(192,192,192);

border-radius    : 0.25em;

background       : rgb(224,224,224);

background-image :    -moz-linear-gradient(rgb(240,240,240),rgb(224,224,224));

background-image :     -ms-linear-gradient(rgb(240,240,240),rgb(224,224,224));

background-image :      -o-linear-gradient(rgb(240,240,240),rgb(224,224,224));

background-image : -webkit-linear-gradient(rgb(240,240,240),rgb(224,224,224));

background-image :         linear-gradient(rgb(240,240,240),rgb(224,224,224));

vertical-align   : bottom;

}

input[type=radio   ]:not(old):checked + label > span{

background-image :    -moz-linear-gradient(rgb(224,224,224),rgb(240,240,240));

background-image :     -ms-linear-gradient(rgb(224,224,224),rgb(240,240,240));

background-image :      -o-linear-gradient(rgb(224,224,224),rgb(240,240,240));

background-image : -webkit-linear-gradient(rgb(224,224,224),rgb(240,240,240));

background-image :         linear-gradient(rgb(224,224,224),rgb(240,240,240));

}

input[type=radio]:not(old):checked +  label > span > span{

display          : block;

width            : 0.5em;

height           : 0.5em;

margin           : 0.125em;

border           : 0.0625em solid rgb(115,153,77);

border-radius    : 0.125em;

background       : #000;

}
</style>

<script>

function clickLvl() {

var event = document.createEvent('MouseEvent');

event = new CustomEvent('click');

var a = document.getElementById('lvlLink');

a.dispatchEvent(event);

}

function clickVP() {

var event = document.createEvent('MouseEvent');

event = new CustomEvent('click');

var a = document.getElementById('vpLink');

a.dispatchEvent(event);

}

function clickDivision() {

var event = document.createEvent('MouseEvent');

event = new CustomEvent('click');

var a = document.getElementById('divisionLink');

a.dispatchEvent(event);

}

function clickDepartment() {

var event = document.createEvent('MouseEvent');

event = new CustomEvent('click');

var a = document.getElementById('departmentLink');

a.dispatchEvent(event);

}

function clickClass() {

var event = document.createEvent('MouseEvent');

event = new CustomEvent('click');

var a = document.getElementById('classLink');

a.dispatchEvent(event);

}

</script>

</head>

<body>

<a id="lvlLink" href="mstr://?evt=2048076&psName=ttl|comp&pName=Panel3531|Panel3531"></a>

<a id="vpLink" href="mstr://?evt=2048076&psName=ttl|comp&pName=Panel3535|Panel3535"></a>

<a id="divisionLink" href="mstr://?evt=2048076&psName=ttl|comp&pName=Panel3534|Panel3534"></a>

<a id="departmentLink" href="mstr://?evt=2048076&psName=ttl|comp&pName=Panel3533|Panel3533"></a>

<a id="classLink" href="mstr://?evt=2048076&psName=ttl|comp&pName=Panel4483|Panel4431"></a>
<div class="buttons">
<div>

<input id="radio1" type="radio" name="radio" value="1" checked="checked" onclick="clickLvl()"><label for="radio1"><span><span></span></span>Button 1</label></div>
<div>

<input id="radio2" type="radio" name="radio" value="2"><label for="radio2" onclick="clickVP()"><span><span></span></span>Button 2</label></div>
<div>

<input id="radio3" type="radio" name="radio" value="3"><label for="radio3" onclick="clickDivision()"><span><span></span></span>Button 3</label></div>
<div>

<input id="radio4" type="radio" name="radio" value="4"><label for="radio4" onclick="clickDepartment()"><span><span></span></span>Button 4</label></div>
<div>

<input id="radio5" type="radio" name="radio" value="5"><label for="radio5" onclick="clickClass()"><span><span></span></span>Button 5</label></div>
</div>
</body>

</html>

Each input is a different radio button.

Just let me know if you need help with this code.

Hope it helps.

God bless you!

Modifying the iPad/iPhone Mstr mobile app settings programatically

Hello there,

Today let’s talk about how to change the MicroStrategy Mobile app settings using Objective C. To do that you will have to use the latest XCode version and the latest MicroStrategy Mobile SDK version as well. Currently I used XCode 8.2.1 and MicroStrategy Mobile SDK 10.4

I had to modify the app to Offline Mode when the user is not connected to the VPN and I couldn’t the code to do that. So, to help you guys, here I’ll explain how to turn on/off the offline mode and how to change the other options too.

First things first.

Step 1: You have to create a custom app delegate class: https://lw.microstrategy.com/msdz/MSDL/104/docs/projects/MobileSDK/Default.htm#topics/iOS/iOS_Adding_Functionality_with_a_CustomApplDelegate.htm?Highlight=creating a custom

Step 2: Add the BooleanPreference.h file to the Custom Folder:

Just right click on the Custom folder and select “New File”and create a new header file. The name of the file must be BooleanPreference.h

Copy this content into this file:

#import <Foundation/Foundation.h>
@class MSIDevicePreferences;
@interface BooleanPreference : NSObject {
@private
    NSString* prefID;
    BOOL booleanValue;
    MSIDevicePreferences * __weak parent;
}
@property (nonatomic, copy) NSString* prefID;
@property (nonatomic) BOOL booleanValue;
-(BooleanPreference*)initWithID:(NSString*)_prefID boolValue:(BOOL)_value;
@end

Step 3: Your CustomAppDelegate.h must looks like this:

#import <UIKit/UIKit.h>
#import <MicrostrategyMobileSDK/MSIAppDelegateImpl.h>
#import <MicrostrategyMobileSDK/MSICommanderDelegate.h>
#import <MicrostrategyMobileSDK/MSIPreferencesStore.h>
#import <BooleanPreference.h>
@interface CustomAppDelegate : MSIAppDelegateImpl
@end

Step 4: Your CustomAppDelegate.m must looks like this:

#import “CustomAppDelegate.h”
@implementation CustomAppDelegate
-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{
BOOL res = [super application:application didFinishLaunchingWithOptions:launchOptions];
// Retrieve preferences
MSIPreferencesStore *store = [MSIPreferencesStore preferencesStore];
MSIDevicePreferences *dp= [store preferencesCopy];
BooleanPreference *boolPref = [dp getIsOfflineMode]; // Here, instead of using “getIsOfflineMode” you will be able to use the other possible options. Just remove it and start typing again and // XCode will show you the other options here
//Offline Mode on
boolPref.booleanValue = YES;
// Store new preferences
[store storePreferences:dp];
}
@end

That is it.

Hope it helps!

Just let me know if you need help with your code.

God bless you!

Best practices while using offline mode for MicroStrategy Mobile

Hello there,

I found a very good TN that explains the best practices when  using Microstrategy mobile in offline mode.

Below is the link:

https://community.microstrategy.com/t5/Mobile/TN199366-Best-practices-to-design-or-utilize-mobile-dashboards/ta-p/199366

 

Hope it helps.

God bless you!

URL API to renew Mobile cache

Hello there,

Today let’s talk about how to force the mobile app to get the new cache from IS using an URL API.

To do that, just add one of those URLs as a link:

mstr://?evt=2048030&useCache=0, refresh against data warehouse and generate new cache in Intelligence Server. 

mstr://?evt=2048030, refresh against existing Intelligence Server cache;

mstr://?evt=2048030&useCache=1, refresh against existing Intelligence Server cache;

mstr://?evt=2048030&useCache=, refresh against existing Intelligence Server cache;

Hope it helps!

God bless you!

Source: https://community.microstrategy.com/t5/SDK/TN44852-How-to-Purge-Server-Cache-and-Refresh-a-Report-Service/ta-p/194578

Using previous selections while clicking in a new document in MicroStrategy Mobile

Hello there!

Today let’s talk about a very quick tip of how to pass selected elements in previous selectors from one document to another in MicroStrategy Mobile.

You just have to:

  1. Get the URL for a dashboard;
  2. Create a link using an image, for example;
  3. Add “&prevMsgID=” parameters to the URL. Like this:

./mstrWeb?evt=2048001&documentID=0000000000000&prevMsgID=

MicroStrategy will automatically use the previous elements selected for new document.

Hope it helps.

God bless you!

How to test your MicroStrategy Project for the newest MicroStrategy Mobile version

Hello there!

Today let’s talk about a good tip: How to test if your project is good to run in the newest MicroStrategy App?

MicroStrategy has 2 apps in apple store: MicroStrategy Analytics for iPad and MicroStrategy Mobile for iPad.

MicroStrategy Analytics for iPad is used for demos proposes and MicroStrategy Mobile for iPad for enterprise usage.

But, sometimes the Analytics is updated and the Mobile not, so you can test if your project will be good for the newest Mobile update.

To use the Analytics to test you just have to:

1. Get the URL from Mobile Configuration

Capture

2. Change the mstr to analytics:

Capture

From:

mstr://?url=http%3A%2F%2F192.168.1.1%3A80%2FMicroStrategyMobile%2Fasp%2FTaskProc.aspx%3FtaskId%3DgetMobileConfiguration%26taskEnv%3Dxml%26taskContentType%3Dxmlanf%26configurationID%3Dfa87d1ba-9ac8-42e0-b546-8e4b30772d70&authMode=1&dt=2

To:

analytics://?url=http%3A%2F%2F192.168.1.1%3A80%2FMicroStrategyMobile%2Fasp%2FTaskProc.aspx%3FtaskId%3DgetMobileConfiguration%26taskEnv%3Dxml%26taskContentType%3Dxmlanf%26configurationID%3Dfa87d1ba-9ac8-42e0-b546-8e4b30772d70&authMode=1&dt=2

 

That’s it. Now you can test your project if everything is ok for the newest version.

 

God bless you!

Reset MicroStrategy Mobile App

Hello there!

Today let’s talk about how to erase every project configured in your MicroStrategy Mobile App and reset to factory settings.

The easiest way to do that is to:

1. Open Safari App (iOS) or Chrome App (Androido) in your mobile device;

2. Go to: http://www.microstrategy.com/config;

3.  Tap “Restore MicroStrategy App Defaults”;

 

Now your MicroStrategy Mobile will be reset to the factory settings.

Hope it helps.

 

God bless you.