Document property value doesn't get updated automatically. Any suggestions?

Hi Folks,

I have a script that sets a document property to the value of the Month from the data table and this property I'm displaying it in my bar chart title to show the no of products sold for the current Month.

The issue that I'm facing is that the document property doesn't get updated, it still retains the old value until we click on the Run script manually).

Is there a way to fix this?

Below is the script that I'm using:

from Spotfire.Dxp.Data import RowSelection,DataValueCursor
from Spotfire.Dxp.Data import IndexSet,DataPropertyClass
from Spotfire.Dxp.Data import DataPropertyClass
from System import String

dTable=Document.Data.Tables["Summary"]
#Identify the number of rows in the table
rowCount=dTable.RowCount
#Set the Index set to True for particular rows in  table
rowsToInclude = IndexSet(rowCount,True)
#print rowsToInclude
cursor = DataValueCursor.CreateFormatted(dTable.Columns["CurrentMonthName"])
#print cursor
for  row in  dTable.GetRows(rowsToInclude,cursor):
   rowIndex = row.Index
   RepMonth = cursor.CurrentValue
   #print RepMonth
Document.Properties["currmonth"] = RepMonth

 

Thanks.

 

 

 

(1) Answer

Login