Jump to content

CrossTable column alignment using IronPython


Marcio Souza

Recommended Posts

Hello Everyone!

I'm trying t figure out if there is any way to set column (header and data) alignment using IronPython. I'm using a script code to generate the cross table axis like so dynamically:

from Spotfire.Dxp.Application.Visuals import TablePlot, VisualContent

from Spotfire.Dxp.Data import *

 

yAxis = Document.Properties["Y"]

print yAxis

 

xAxis = Document.Properties["X"]

print xAxis

 

def getVisual(visualTitle):

for vis in Document.ActivePageReference.Visuals:

if vis.Title == visualTitle:

return vis.As[VisualContent]()

raise ("Error - cannot find visual: " + visualTitle)

 

#get underlying data table

dt = getVisual("Result")

 

if yAxis and not yAxis.isspace():

# Horizontal:

dt.ColumnAxis.Expression = ""

 

# Vertical:

dt.RowAxis.Expression = yAxis

 

# Cell values:

dt.MeasureAxis.Expression = xAxis

Since columns are defined dynamically, I need to align them appropriately for each column selected by the user. I was wondering if I can do this using a script to format the table accordingly.

Regards,

Marcio

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...