As a transitional step, this site will temporarily be made Read-Only from July 8th until the new community launch. During this time, you can still search and read articles and discussions.

While the community is read-only, if you have questions or issues requiring TIBCO review/response, please access the new TIBCO Community and select "Ask A Question."

You will need to register or log in or register to engage in the new community.

How to tag marked rows in TIBCO Spotfire® using IronPython Scripting

Last updated:
9:28pm Aug 26, 2019

Back to main IronPython scripting page

Introduction

This article demonstrates how to tag marked rows

Code Sample

# Copyright © 2017. TIBCO Software Inc. Licensed under TIBCO BSD-style license.

from Spotfire.Dxp.Data import DataColumn, TagsColumn
from Spotfire.Dxp.Data import DataPropertyClass, DataType, DataValueCursor, IDataColumn, IndexSet
from Spotfire.Dxp.Data import RowSelection 
 
# Tag the marked rows
markedRowSelection = Document.ActiveMarkingSelectionReference.GetSelection(Document.ActiveDataTableReference)
table = Document.ActiveDataTableReference

#Get handle to the required column and typecast it to a tagcolumn
myTagColumn = table.Columns.Item["GROUP"].As[TagsColumn]()
selectRows = IndexSet(table.RowCount, True)

#Loop through the tag list and add the tagged/nontagged rows
tags =  myTagColumn.TagValues
for t in tags:
 if t == 'Tag 1':
  myTagColumn.Tag(t, RowSelection(selectRows))
 if t == 'Tag 2':
  myTagColumn.Tag(t, markedRowSelection)
  

 

References

 

License:  TIBCO BSD-Style License

Feedback (1)

Ty very much. It was very usefull! :D

lorenafmarani 9:50am Apr. 07, 2020