This article shows a sample script on how to change the column formatting using IronPython Scripting.
Introduction
This article shows a sample script on how to change the column formatting using IronPython Scripting.
Code Sample
# Copyright © 2017. TIBCO Software Inc. Licensed under TIBCO BSD-style license. from Spotfire.Dxp.Data import * from Spotfire.Dxp.Data.Formatters import * from System import Globalization dataTable=Document.ActiveDataTableReference column = dataTable.Columns["Spent"] #to create a culture specificFormatter gbp = Globalization.CultureInfo("en-GB") formatter = DataType.Real.CreateCultureSpecificFormatter(gbp) #To create a localized formatter #formatter = DataType.Real.CreateLocalizedFormatter() formatter.Category=NumberFormatCategory.Currency formatter.DecimalDigits = 2 formatter.GroupSeparatorEnabled=True formatter.ShortFormattingEnabled=True column.Properties.Formatter = formatter
References
License: TIBCO BSD-Style License
Recommended Comments
There are no comments to display.