Jump to content
  • This article provides a sample IronPython script reference which add a data table based on Information Link that has Stored Procedure as its element

    Introduction

    This article provides a sample IronPython script reference which add a data table based on Information Link that has Stored Procedure as its element

    Code Sample

    # Copyright © 2019. TIBCO Software Inc. Licensed under TIBCO BSD-style license.
    
    from System import Array,Guid,String,Object, DateTime
    from Spotfire.Dxp.Data.Import import InformationLinkDataSource, InformationLinkParameter
    from Spotfire.Dxp.Data import *
    
    
    #The GUID of the information link to be executed (Right-click, Copy ID from the information designer)
    ilGuid = "a7e024a5-9582-44df-ac9a-e78a38abcad8"
    
    ilDataSource=InformationLinkDataSource(Guid(ilGuid))
    # Get the InformationLink Descriptor and list of referenced Parameters
    descriptor=ilDataSource.GetInformationLinkDescriptor((Guid(ilGuid)))
    referencedParameters=descriptor.ReferencedParameters
    
    
    #define values for the parameters referred in the Stored Procedure
    param1Value = 135
    param2Value=37
    
    
    
    #list to save information link parameters
    ilParameters = []
    
    #create parameter
    ilParameter1 = InformationLinkParameter.CreateReferencedParameter(referencedParameters[0].ElementIdentifier,referencedParameters[0].ParameterId, Array[Object]([param1Value]))
    ilParameters.append(ilParameter1)
    
    ilParameter2 = InformationLinkParameter.CreateReferencedParameter(referencedParameters[1].ElementIdentifier,referencedParameters[1].ParameterId, Array[Object]([param2Value]))
    ilParameters.append(ilParameter2)
    
    #Assign the parameters
    ilDataSource.Parameters = ilParameters
    
    Document.Data.Tables.Add("IL_StoredProcedure",ilDataSource)
     

    References

    License:  TIBCO BSD-Style License

     

     


    User Feedback

    Recommended Comments

    There are no comments to display.


×
×
  • Create New...