EducationSoftwareStrategy.com
StrategyCommunity

Knowledge Base

Product

Community

Knowledge Base

TopicsBrowse ArticlesDeveloper Zone

Product

Download SoftwareProduct DocumentationSecurity Hub

Education

Tutorial VideosSolution GalleryEducation courses

Community

GuidelinesGrandmastersEvents
x_social-icon_white.svglinkedin_social-icon_white.svg
Strategy logoCommunity

© Strategy Inc. All Rights Reserved.

LegalTerms of UsePrivacy Policy
  1. Home
  2. Topics

KB439582: How to Get the Title of a Grid Visualization in a Visual Insight Dashboard Using MicroStrategy Web SDK 10.x


Community Admin

• Strategy


Using Web SDK to get the Title Name of a Grid Visualization in MicroStrategy Web

The following code sample shows how to get the Title of a Grid on a Visual Insight dashboard in Strategy Web using Web SDK:

ka04W000000OcFSQA0_0EM44000000QII2.jpeg





package com.Strategy.sdk.standalone;

import com.Strategy.web.beans.BeanFactory;
import com.Strategy.web.beans.RWBean;
import com.Strategy.web.beans.WebBeanException;
import com.Strategy.web.objects.WebFormat;
import com.Strategy.web.objects.WebFormatIterator;
import com.Strategy.web.objects.WebIServerSession;
import com.Strategy.web.objects.WebObjectsException;
import com.Strategy.web.objects.WebObjectsFactory;
import com.Strategy.web.objects.rw.EnumRWUnitTypes;
import com.Strategy.web.objects.rw.RWDefinition;
import com.Strategy.web.objects.rw.RWGridGraphDef;
import com.Strategy.web.objects.rw.RWInstance;
import com.Strategy.web.objects.rw.RWUnitDef;
import com.Strategy.webapi.EnumDSSXMLApplicationType;

public class test { 
    
private static WebObjectsFactory factory = null;
     private static WebIServerSession serverSession = null;
     public static void main(String[] args) throws WebObjectsException, IllegalArgumentException, WebBeanException {
          
        if (serverSession == null) {    
               // create factory object
               factory = WebObjectsFactory.getInstance();
               serverSession = factory.getIServerSession();
                // Set up session properties
               serverSession.setServerName("SERVERNAME"); // Should be replaced with the name of an Intelligence Server
               serverSession.setServerPort(0);
               serverSession.setProjectName("PROJECTNAME"); // Project where the session should be created
               serverSession.setLogin("USERNAME"); // User ID
               serverSession.setPassword("PASSWORD"); // Password
               serverSession.setApplicationType(EnumDSSXMLApplicationType.DssXmlApplicationCustomApp);
              
        }
        String docID = "B3393A5A4A4F549123C530905441E690";
        
         RWBean rwBean = (RWBean) BeanFactory.getInstance().newBean("RWBean"); 
         rwBean.setSessionInfo(serverSession); 
         rwBean.setObjectID(docID);
         rwBean.collectData(); 
        
         RWInstance rwInstance = rwBean.getRWInstance();        
         rwInstance.setAsync(false);

         RWDefinition oDef = rwInstance.getDefinition();
         
         // Get Grid units within the VI dashboard:
         RWUnitDef[] rwUnitDefs = oDef.findUnitsByType(EnumRWUnitTypes.RWUNIT_GRIDGRAPH);

// Loop through all Grid objects in the document
         for (int i = 0; i < rwUnitDefs.length; i++) { 
           RWUnitDef rwUnit = rwUnitDefs[i]; 
           RWGridGraphDef gridDef = (RWGridGraphDef) rwUnit; 
           
   // Get the formatting properties of the grid
   WebFormat format = gridDef.getFormat();
           
   // Iterate through formatting properties if needed.
   //WebFormatIterator wfi = format.getIterator();
           //while(wfi.nextPropertySet()){
        //     System.out.println("Property Name Set " + wfi.getPropertySetName());
        //     while(wfi.nextProperty()){
        //      System.out.println("-----Property Name " + wfi.getPropertyName());
        //     }
        //    }
           
   // Output the title of the Visualization:
           System.out.println("Title: " + format.getValue("FormattingView", "Title"));
         }
     }
}

ADDITIONAL INFORMATION:
The Strategy SDK allows you to customize the standard Strategy Web interface, and extend and integrate the Strategy business intelligence functionality into other applications. However, before changing the way Strategy Web products look or behave, it is helpful to understand how the application is built. For more information regarding the Strategy Web architecture or the process of customizing Strategy Web, please refer to Strategy Developer Zone (https://resource.Strategy.com/msdz/).
 
Customization Warning:
This customization is provided as a convenience to Strategy users and is only directly applicable to the version stated. While this code may apply to other releases directly, Strategy Technical Support makes no guarantees that the code provided will apply to any future or previous builds. In the event of a code change in future builds, Strategy Technical Support makes no guarantee that an updated version of this particular customization will be provided. For enhancements to this customization or to incorporate similar functionality into other versions, contact your Account Executive to inquire about Strategy Consulting assistance.
 
Disclaimers and Limitation of Liabilities
Disclaimer:The utility application is provided "as is" and without warranty of any kind. Strategy Expressly disclaims all warranties, express, implied or statutory, including, without limitation, the implied warranties of merchantability, fitness for a particular purpose, satisfactory quality and noninfringement.
 
Limitation of Liability: Strategy shall have no liability to licensee for any damages of any kind, including, but not limited to, liability for direct, indirect, special, incidental or consequential, damages (which shall include, but not be limited to, loss of data or information, loss of revenue or anticipated profits or lost business).
 
Third Party Software Installation: WARNING:
The third-party product(s) discussed in this technical note is manufactured by vendors independent of Strategy. Strategy makes no warranty, express, implied or otherwise, regarding this product, including its performance or reliability.
  KB439582


Comment

0 comments

Details

Knowledge Article

Published:

February 2, 2018

Last Updated:

November 12, 2018