Tag Archives: url api

Link to different reports in a grid/graph

Hello there!

Today I’m going to talk about how to link to different reports/documents using the same grid/graph without any intervention from the user.

As you may know, when you create a link to a report/document in a grid/graph you can specify more than one hyperlink. But, when the user clicks on a specific item, it shows all hyperlinks and he/she has to choose which hyperlink to click on.

What if you must go to a specific report/document for item A, to another for item B, etc, and if the user choose a wrong one, the result is going to be wrong…

So… Let’s do that!

I’m going to use SQL SERVER as my Data warehouse in this example. The syntax may vary if you use different Database.

1. I’m going to create 2 reports that’s going to be used as the link.

2. Get the ID of them. To do that, you can use MicroStrategy Developer, right click on the report 1 -> go to Properties -> Copy the content of the ID field. In my case, for report 1 the ID is 6360D76C4D340D8B79D988A9A759485B and for report 2 is 8F43AC804E18E30709B73DAB83413D00.

3. Now, I’m going to create a FreeForm SQL report using this SQL:

SELECT a11.[CATEGORY_DESC] as CATEGORY_DESC,
CASE
a11.[CATEGORY_DESC]
WHEN 'Book' THEN ('6360D76C4D340D8B79D988A9A759485B')  
WHEN 'Electronics' THEN ('8F43AC804E18E30709B73DAB83413D00')  END 
FROM [LU_CATEGORY] a11

In my CASE statement, I’m specifying to Microstrategy which report has to be used for each specific category.

Now, create 2 managed atributes for that FreeForm.

ID_REPORT     attribute form: ID

ID_REPORT_DESC     attribute form: DESC

And then save it as baseReport.

4. Create a new dashboard and insert a Vertical Bar Graph using the baseReport as the source.

5. Create a Panel Stack and set it as an Information Window.

6. Now, I will use Microstrategy Web to see the links to my reports. To do that, just browse the folders until you see your saved reports -> Right click on Report 1 -> Go to Share -> Show Link -> Copy the content of it.

7. Copy the link an replace the reportID with {ID_REPORT_DESC}:

http://localhost/MicroStrategy/asp/Main.aspx?evt=4001
&src=Main.aspx.4001&
reportID=6360D76C4D340D8B79D988A9A759485B
&visMode=0&reportViewMode=1
&server=SERVER195&Project=EXAMPLE01&port=0&share=1

Just change the reportID content to {ID_REPORT_DESC}.

http://localhost/MicroStrategy/asp/Main.aspx?evt=4001
&src=Main.aspx.4001&
reportID={ID_REPORT_DESC}
&visMode=0&reportViewMode=1
&server=SERVER195&Project=EXAMPLE01&port=0&share=1

Insert an HTML Container object inside the Information Window Panel Stack and add the <a> HTML tag to create a link. Something like this:

 <a href="http://localhost/MicroStrategy/asp/Main.aspx?evt=4001
&src=Main.aspx.4001&reportID={ID_REPORT}&visMode=0
&reportViewMode=1&server=SERVER195
&Project=EXAMPLE01&port=0&share=1" target="_blank">Link</a>

I just added target=”_blank” to open the link in another window. If you don’t want that, just remove it.

“Link” is the static text that will appears after you click on the bar of your graph, you can change to another

Right click on the attribute of the graph -> Click on “use as selector” and target the panel stack that was used as the Information Window.

 

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

Exporting the document with the current selections

Hello there,

Today I’ll explain how to export the current document with the current selections.

To export to PDF, you just have to create a hyperlink using:

ASPx:

Main.aspx?evt=3069&src=Main.aspx.3069&executionMode=3&messageID={&DOCUMENTMESSAGEID}

JSP:

mstrWeb?evt=3069&src=mstrWeb.3069&executionMode=3&messageID={&DOCUMENTMESSAGEID}

 

To export to Excel, you just have to use these urls:

ASPx:

Main.aspx?evt=3069&src=Main.aspx.3069&executionMode=4&messageID={&DOCUMENTMESSAGEID}

JSP:

mstrWeb?evt=3069&src=mstrWeb.3069&executionMode=4&messageID={&DOCUMENTMESSAGEID}

 

Hope it helps!

God bless you!

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!

Dynamic URL API for HTML Container

Hello there!

Today let’s talk about a quick tip: how to create a dynamic url api for HTML Container.

For J2ee you can do it:

./mstrWeb?Server={&SERVERNAME}&Project={&PROJECT}& …

Where is the rest of the parameters for the url.

For IIS:

./Main.aspx?Server={&SERVERNAME}&Project={&PROJECT}& …

pic

Hope it helps!

God bless you!

OLAP Metric Functions

Hello there!

I’ve created a website for Microstrategy Online Courses.

Now I’m recording an URL API course (Portuguese) and an Olap Metric Functions course (Portuguese). If you are interested in Microstrategy online courses, that site can help you out!

I’m going to record in Portuguese and in English.

Hope you enjoy it.

God bless you!

Using Task API getSessionState with PHP in IIS

Hello there!

Today let’s talk about how to create a session using PHP with IIS.

First, enable Basic Authentication on MicroStrategy Virtual Site in IIS.

You just have to use this code:

<?php
$username = 'username';
$password = 'password';
$context = stream_context_create(array(
 'http' => array(
 'header' => "Authorization: Basic " . base64_encode("$username:$password")
 )
));
$url = file_get_contents("http://localhost/MicroStrategy/asp/TaskAdmin.aspx? 
taskId=getSessionState&taskEnv=xml&taskContentType=xml&server=localhost&project=MicroStrategy 
+Tutorial&uid=administrator&pwd=", false, $context);
$data=simplexml_load_string($url);


foreach($data->children() as $child) {
foreach($child->children() as $child1) {
$sessionmstr = $child1;
break;
}
}
header(“Location: http://server/Microstrategy/asp/Main.aspx?evt=2048001&src=Main.aspx.2048001&visMode=0&currentViewMedia=2&documentID=IDOFTHEDOCUMENT1&server=server&Project=NAMEOFTHEPROJECT&port=0&share=1&usrSmgr=$sessionmstr“);
?>

Remember to change the username and password to use your username and password for login in TASK API page. And in file_get_contents and header(“Location…, change the url to use your own urls.

Hope it helps!
God bless you!