Tuesday, July 14, 2015

Show/Hide Input Text Box based on Dropdown Selection using Jquery

Using Jquery we can show/hide the input box based on the Spotfire Drop Down selection.

Lets assume we have created a Drop-Down Property control with Fixed Values
as Enable and Disable as below



  
Also, create a Input property control.






Drop -Down Property Control ID: 163473c4bab648778b3e64c40463e3f  
Input Text Box Control ID:  c8b6b12144864ec5889005c6260a4b08

Now our aim is to show/hide the Input Text box based on the Drop down selection.


The default HTML would look like below:-
 

Click on JSscript Button and create below script as below:-
 

  
JScript will triggered whenever the Drop Down selection is changed.

Below is the Script.

//Triggering the script if Drop Down selection is varied
$("#163473c4bab648778b3e64c40463e3fc").change(function()

{
    var value = $("#163473c4bab648778b3e64c40463e3fc").val();  //To capture the index
    var vt = $("#163473c4bab648778b3e64c40463e3fc option:selected").text(); //To Capture the  selected text
    if(vt== "Enable")   //If the Drop Down selected value is Enable
    {
        $("#c8b6b12144864ec5889005c6260a4b08").show(); //Making the Input Box visible
    }
    else
    {
        $("#c8b6b12144864ec5889005c6260a4b08").hide(); //Making the Input box element hidden
    }
}
);




Sunday, July 12, 2015

Get Visible Filters Information - Python Script


Below is the script to get details of Visible Filters from Filter Panel

 
import Spotfire.Dxp.Application.Filters as filters
from Spotfire.Dxp.Application.Filters import *


# Navigate through each page in the analyses
for eachPage in Document.Pages:
# Get the active data table in the current page
        activeTable = eachPage.ActiveDataTableReference
        print activeTable.Name
# Get the set of all table groups in the current page
        tableGroup = eachPage.FilterPanel.TableGroups
# Navigate through all the table groups in the filter panel of current page
        for t in tableGroup:
# To filter on the active data table used in the filter panel
                if (t.Name == activeTable.Name):
                        print t.Panel.FilteringSchemeReference.FilteringSelectionReference.Name
                        for filterHandle in t.FilterHandles:
                                filterReference = filterHandle.FilterReference
                                if filterHandle.Visible==True:
                                                print filterReference.Name
                                                print filterHandle.FilterReference.ToString()

Spotfire Statistics Server Configuring with Open Source R


Before Downloading and Installing the R Open Source Engine on the machine, check for the Tibco Spotfire Statistics Requirements.

http://support.spotfire.com/sr_statservices70.asp



For Spotfire 6.5 Version, the highest supported version is 3.1.2.

Now we can go ahead and install R 3.1.2 from the Cran R project site

http://cran.r-project.org/bin/windows/base/old/3.1.2/


Steps:
- Install Tibco Statistics Server 6.5 (64 bit) on Server with engine as SPLUS or  TERR
- Install 64 bit Java JRE (jre1.8.0_45) on Statistics server machine.
- Run the below command from R console
     install.packages("rJava")

   R console location: [R location]\R-3.1.2\bin\x64

-  To verify whether rJava is successfully installed or not, run the below command and it shouldn't return any error message

  library(rJava)



 - Now, navigate to the folder [Tibco Statistics Server path]\statsvcs65\SplusServer\conf. 

 ex:-  C:\Program Files\TIBCO\statsvcs65\SplusServer\conf

- Open spserver.properties and look for engine.type and update the value to R.
     engine.type=R

- Now open the Command prompt using Run as Administration and go to Tibco Statistics Server bin location and run the command 
           TSSS65SplusServerw//ES/TSSS65SplusServer

 

- Then you would get below prompt window and Stop the service.





 - Go to Java -> Java Options and Add below entry to the list
         -Dspserver.rhome=C:\Program Files\R\R-3.0.2



 
 - Apply the changes and start the service

These are the settings/steps from Server side.